Example #1
0
        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));
        }
Example #2
0
        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);
        }