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."); }
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); }
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); }
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); }
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); }