Test Case Of Data Access Layer Function in Play:-

Table of contents
Reading Time: < 1 minute

In this blog I am trying to show how to create test case of data access layer function.
Lets have following function of DAL (data access layer) as an example in models packegae of play.

All the necessary files must be imported to avoid errors.

Now the test case of above function must be created in Test directory in play.
In this test case I am using FunSuite test library :- A suite of tests in which each test is represented as a function value. The “Fun” in FunSuite stands for “function.”

All the necessary files must be imported.

The values passed to the DAL function in a test is dummy data.Once the DAL function is processed the expected result is asserted.

If the asserted value is correct the test passes.

reference*

http://www.artima.com/docs-scalatest-2.0/index.html#org.scalatest.FunSuite

Discover more from Knoldus Blogs

Subscribe now to keep reading and get access to the full archive.

Continue reading