Ejemplo n.º 1
0
        public void GetProduct_ShouldNotFindProduct()
        {
            var controller = new SimpleProductController(GetTestProducts());

            var result = controller.GetProduct(999);

            Assert.IsInstanceOfType(result, typeof(NotFoundResult));
        }
Ejemplo n.º 2
0
        public void GetProduct_ShouldReturnCorrectProduct()
        {
            var testProducts = GetTestProducts();
            var controller   = new SimpleProductController(testProducts);

            var result = controller.GetProduct(4) as OkNegotiatedContentResult <Product>;

            Assert.IsNotNull(result);
            Assert.AreEqual(testProducts[3].Name, result.Content.Name);
        }