Exemplo n.º 1
0
        public void CompletedTest()  // return View()
        {
            // Arrange - create a mock order processor
            Mock <IOrderProcessor> mock = new Mock <IOrderProcessor>();
            // Arrange - create a cart with an item
            Cart cart = new Cart();
            // Arrange - create an instance of the controller
            CartController target = new CartController(null, mock.Object);

            // Act - try to checkout
            //ViewResult result = target.Checkout(cart, new ShippingDetails());
            ViewResult result = target.Completed();

            Console.WriteLine("\n\n************************CompletedTest***************************\n\n");
            Console.WriteLine(result.ViewName);
            Console.WriteLine(result.MasterName);
            Console.WriteLine(result.ToString());
            Console.WriteLine(result.Model);
            Console.WriteLine(result.ViewData);
            Console.WriteLine(result.View);
            Console.WriteLine("\n\n*************************CompletedTest**************************\n\n");

            // Assert - check that the method is returning the Completed view
            //Assert.AreEqual("Completed", result.ViewName);
        }