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

            rule.IsApplicable(product).Should().BeFalse();
        }
        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.");
        }
Пример #3
0
        public void SatifyIfItemTypeInOrderIsAPhysicalProduct()
        {
            var item = new Item {
                Id = 1, ItemType = ItemType.PhysicalProduct, Name = "S    ome Product"
            };

            var productRule = new PhysicalProductRule();

            var actual = productRule.IsApplicable(item);

            Assert.True(actual);
        }