Now we will continue building our application. Let's add BDD tests in our application. We will start doing tests for your services. We have to test ProductService
, ImageService
, and ReviewService
.
Your ProductServiceTestSpec.scala file
should contain the following code:
class ProductServiceTestSpec extends PlaySpec { "ProductService" must { val service:IProductService = new ProductService "insert a product properly" in { val product = new models.Product(Some(1), "Ball","Awesome Basketball",19.75) service.insert(product) } "update a product" in { val product = new models.Product(Some(1), "Blue Ball","Awesome Blue Basketball",19.99) service.update(1, product) } "not update because does not exit" in { intercept[RuntimeException]{ service...