mardi 12 juin 2018

Understanding test suites

I'm learning scalatest and have a question about suites. I want to test a

class ByteSource(val src: Array[Byte])

And logically I splitted the test cases into the following two:

  1. Empty byte source
  2. Non empty byte source

The question is if it's correct to split the cases into different suites like this:

class ByteSourceTest extends FunSpec with Matchers{
    describe("empty byte source operations"){
        //...
    }

    describe("non-empty byte source operations"){
        //...
    }
}

Or FunSpec does not quite suitable for such a case?

Aucun commentaire:

Enregistrer un commentaire