public void Can_Add_To_Cart() { var comparison = new Comparison(); sutController = new ComparingController(sutMock.Object); sutController.AddToCompare(comparison, 1, null); Assert.AreEqual(comparison.Planes.Count(), 1); Assert.AreEqual(comparison.Planes.ToArray()[0].WarplaneID, 1); }
public void Adding_Product_To_Cart_Goes_To_Cart_Screen() { var comparison = new Comparison(); sutController = new ComparingController(sutMock.Object); var result = sutController.AddToCompare(comparison, 2, "myUrl"); Assert.AreEqual(result.RouteValues["action"], "Index"); Assert.AreEqual(result.RouteValues["returnUrl"], "myUrl"); }