public void GetProduct_ShouldReturnWrongProduct() { var controller = new ProductController(); List<Product> products = new List<Product>(controller.products); var result = controller.GetProduct(1) as OkNegotiatedContentResult<Product>; Assert.IsNotNull(result); Assert.AreNotEqual(result.Content.Name, products[1]); }
public void TestGetProduct() { //Setup var controller = new ProductController(); List<Product> products = (new List<Product>(controller.products)); //Action var result = controller.GetProduct(2) as OkNegotiatedContentResult<Product>; Assert.IsNotNull(result); Assert.AreEqual(result.Content.Name, products[1].Name ); }