예제 #1
0
        public void Test_OrdersView()
        {
            // Arrange
            MVCController controller = new MVCController(new RespiratoryStub());

            // Act
            ViewResult result = controller.OrdersView() as ViewResult;

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(1, ((IEnumerable<Orders>)result.Model).First().OrderID);
        }
예제 #2
0
        public void Contact()
        {
            // Arrange
            MVCController controller = new MVCController(new RespiratoryStub());

            // Act
            ViewResult result = controller.ProductsView(null) as ViewResult;
            ViewResult result2 = controller.ProductsView(1) as ViewResult;

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(1, ((IEnumerable<Products>)result.Model).First().ProductID);
            Assert.AreEqual(1, ((IEnumerable<Products>)result2.Model).First().ProductID);
        }