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.