예제 #1
0
        public void CheckPaymentForBook_ThenGenerate_DuplicatePackingSlip_ForRoyality()
        {
            // Arrange
            var product = new Product()
            {
                Name = "My Book", ProductId = "cl-001", ProducType = ProductTypes.Books, ProductPrice = 25.5F
            };
            var order = new Order()
            {
                OrderId = "ord-0001", CreatedDateTime = DateTime.UtcNow, ProductSelected = new List <Product>()
                {
                    product
                }
            };

            var customer = new Customer()
            {
                CustomerId = "00111", OrderId = "ord-0001", Address = new ShippingAddress()
                {
                    City = "a", CustomeAddressLine1 = "B"
                }
            };
            IPackagingService _packgService = Substitute.For <IPackagingService>();;

            //Act

            var result = _packgService.GeneratePackaging(order, customer);

            //Assert
            Assert.True(result.IsSlipGenerated == true);
            Assert.True(result.SlipType == PackingSlipType.SlipForRoyalty);
        }
예제 #2
0
 private void GenerateDuplicatePackagingSlipForRoyalty(Order order, Customer cust)
 {
     _packgService.GeneratePackaging(order, cust);
 }
 private void GeneratePackagingSlip(Order order, Customer cust)
 {
     _packgService.GeneratePackaging(order, cust);
 }