Relative Content

Tag Archive for scalascalatest

Unable to mock Scala object

I have started working in Scala very recently. I have below code in the main method that I’ll need to mock for writing test cases,

how can I structure a test suite hierarchically

I like ScalaTest, but I’m trying to figure out if I can arrange tests as in the hierarchy below– where finer-grained tests are dependent upon more coarse-grained tests succeeding– for the values they produce– and if those coarser-grained tests fail, don’t bother with the finer-grained ones. For example, I need the parsed PubSub payload before I can parse the message sub-payload, and in turn I need the parsed message sub-payload before I can parse the data sub-sub-payload in the example below.