public void IsApplication_Should_Return_True_For_Physical_Product()
        {
            var rule    = new PhysicalProductRule();
            var product = new Product {
                Attribute = ProductAttribute.PHYSICAL
            };

            rule.IsApplicable(product).Should().BeTrue();
            rule.Apply().Should().Be("Generating a packing slip for shipping.");
        }
Example #2
0
        public void GeneratesACommissionForAgent()
        {
            var item = new Item {
                Id = 1, ItemType = ItemType.PhysicalProduct, Name = "someProduct"
            };

            var productRule = new PhysicalProductRule();

            var actual = productRule.Apply(item);

            Assert.Contains("Commission payment generated for Agent", actual.Activity);
        }
Example #3
0
        public void GeneratesAPackageSlipForShipping()
        {
            var item = new Item {
                Id = 1, ItemType = ItemType.PhysicalProduct, Name = "someProduct"
            };

            var productRule = new PhysicalProductRule();

            var actual = productRule.Apply(item);

            Assert.Contains("Package Slip generated for Shipping", actual.Activity);
        }
Example #4
0
        public void ApplicationReturnsARuleLog()
        {
            var item = new Item {
                Id = 1, ItemType = ItemType.PhysicalProduct, Name = "someProduct"
            };

            var productRule = new PhysicalProductRule();

            var actual = productRule.Apply(item);

            Assert.IsType(typeof(RuleLog), actual);
            Assert.Equal("Physical Product Rule", actual.RuleName);
        }
Example #5
0
        public void ApplysForPhysicalProduct()
        {
            var item = new Item {
                Id = 1, ItemType = ItemType.PhysicalProduct, Name = "someProduct"
            };

            var productRule = new PhysicalProductRule();

            var actual = productRule.Apply(item);

            Assert.NotNull(actual);
            Assert.IsType(typeof(RuleLog), actual);
        }