public void TestPayAllOrder() { var builderOrder = new Mock <IBuilderOrder>(); builderOrder.Setup(m => m.GetOrder()).Returns(new List <Product> { new Product(), new Product(), }); var payOrder = new Mock <IPayOrder>(); var curOrder = new OrderPay(builderOrder.Object, payOrder.Object); payOrder.Verify(m => m.Pay(It.IsAny <Product>()), Times.Exactly(2)); }
public void TestOderBuilder() { var builderOrder = new Mock <IBuilderOrder>(); builderOrder.Setup(m => m.GetOrder()).Returns(new List <Product> { new Product(), new Product(), } ); var payOrder = new Mock <IPayOrder>(); var curOrder = new OrderPay(builderOrder.Object, payOrder.Object); var countOrder = curOrder.GetOrder(); Assert.AreEqual(2, countOrder); }