public void Can_View_Cart_Content() { Cart cart = new Cart(); CartController target = new CartController(null, null); CartIndexViewModel res = (CartIndexViewModel)target.Index(cart, "MyUrl").ViewData.Model; Assert.AreSame(res.Cart, cart); Assert.AreEqual(res.ReturnUrl, "MyUrl"); }
public void Can_View_Cart_Contents() { // Arrange - create a Cart Cart cart = new Cart(); // Arrange - create the controller CartController target = new CartController(null, null); // Act - call the Index action method CartIndexViewModel result = (CartIndexViewModel)target.Index(cart, "myUrl").ViewData.Model; // Assert Assert.AreSame(result.Cart, cart); Assert.AreEqual(result.ReturnUrl, "myUrl"); }
public void Can_View_Cart_Contents() { //arrange create a cart Cart cart = new Cart(); // arrange create the controller CartController controller = new CartController(null, null); // act call the index action method var result = (CartIndexViewModel)controller.Index(cart, "myUrl").ViewData.Model; // assert Assert.AreEqual(result.Cart, cart); Assert.AreEqual(result.ReturnUrl, "myUrl"); }
public void Can_View_Cart_Contents() { // Arrange - Cart 개체를 생성한다. Cart cart = new Cart(); // Arrange - 컨트롤러를 생성한다. CartController target = new CartController(null, null); // Act - Index 액션 메서드를 호출한다. CartIndexViewmodel result = (CartIndexViewmodel)target.Index(cart, "myUrl").ViewData.Model; //Assert Assert.AreSame(result.Cart, cart); Assert.AreEqual(result.ReturnUrl, "myUrl"); }
public void Can_View_Cart_Contents() { Cart cart = new Cart(); CartController target = new CartController(null, null); CartIndexViewModel result = (CartIndexViewModel)target.Index(cart, "myURL").ViewData.Model; Assert.AreSame(result.Cart, cart); Assert.AreEqual(result.ReturnURL, "myURL"); }
public void CanViewCartContents() { //arrange var cart = new Cart(); //arrange var target = new CartController(null, null); //act var result = (CartIndexViewModel) target.Index(cart, "myUrl").ViewData.Model; //assert Assert.AreEqual(cart, result.Cart); Assert.AreEqual("myUrl", result.ReturnUrl); }
public void Can_View_Cart_Contents() { // arrange - creat a cart Cart cart = new Cart(); // arrange create the controller CartController target = new CartController(null, new EmailOrderProcessor(new EmailSettings())); // act - call the index action method CartIndexViewModel result = (CartIndexViewModel)target.Index(cart, "myUrl").ViewData.Model; // assert Assert.AreSame(result.Cart, cart); Assert.AreEqual(result.ReturnUrl, "myUrl"); }
public void CanViewCartContents() { Cart cart = new Cart(); CartController controller = new CartController(null, null); CartIndexViewModel result = (CartIndexViewModel) controller.Index(cart, "myUrl").ViewData.Model; Assert.AreSame(result.Cart, cart); Assert.AreEqual(result.ReturnUrl, "myUrl"); }
public void CartController_Index_CanViewCartContents() { // Arrange Cart cart = new Cart(); var target = new CartController(null, null); // Act var result = (CartIndexViewModel)target.Index(cart, "myUrl").ViewData.Model; // Assert Assert.AreEqual<Cart>(result.Cart, cart); Assert.AreEqual<string>(result.ReturnUrl, "myUrl"); }
public void Can_view_cart_contents() { var cart = new Cart(); var controller = new CartController(null, null); var result = (CartIndexViewModel)controller.Index(cart, "myurl").ViewData.Model; Assert.AreSame(cart, result.Cart); Assert.AreEqual("myurl", result.ReturnUrl); }
public void Can_View_Cart_Contents() { var productsArray = products.Products.ToArray(); Cart cart = new Cart(); CartController target = new CartController(products, orderProcessor); CartIndexViewModel result = (CartIndexViewModel)((ViewResult)target.Index(cart, "testUrl")).ViewData.Model; Assert.AreEqual(result.returnUrl, "testUrl"); Assert.AreEqual(result.cart, cart); }
public void Can_View_Cart_Contest() { //Arrange Cart cart=new Cart(); CartController target=new CartController(null,null); //Act CartIndexViewModel result = (CartIndexViewModel) target .Index(cart, "myUrl").ViewData.Model; //Assert Assert.AreEqual(result.Cart,cart); Assert.AreEqual(result.ReturnUrl,"myUrl"); }
public void Can_View_Cart_Contents() { var url = "someUrl"; // Arrange - create a cart Cart cart = new Cart(); // Arrange - create the controller CartController controller = new CartController(null); // Act var actionResult = controller.Index(url, cart); var model = (CartIndexViewModel) actionResult.Model; Assert.AreSame(model.Cart,cart); Assert.AreSame(model.ReturnUrl, url); }
public void Can_View_Cart_Contents() { // Arrange Cart cart = new Cart(); CartController controller = new CartController(null, null); // Act CartIndexViewModel model = (CartIndexViewModel)controller.Index(cart, "myUrl").Model; // Assert Assert.AreEqual(model.Cart, cart); Assert.AreEqual(model.ReturnUrl, "myUrl"); }