public void CloneCreatesDifferentInstance() { var skuentry = new SkuCartEntry() { Sku = new Sku("A"), Price = 10, Quantity = 1, PromotionRuleId = "Rule x", Description = "Description" }; var cloned = skuentry.Clone() as SkuCartEntry; Assert.False((object)skuentry == (object)cloned); }
public void CloneKeepsReferenceToTheSameSku() { var skuentry = new SkuCartEntry() { Sku = new Sku("A"), Price = 10, Quantity = 1, PromotionRuleId = "Rule x", Description = "Description" }; var cloned = skuentry.Clone() as SkuCartEntry; Assert.True((object)skuentry.Sku == (object)cloned.Sku); }
/// <summary> /// Tests that an entry was not processed by a rule. /// </summary> /// <param name="entry">The entry to test.</param> public static void CheckCartEntryWasNotProcessedByRule(this SkuCartEntry entry) { Assert.Null(entry.PromotionRuleId); }
/// <summary> /// Tests that an entry was processed by a rule. /// </summary> /// <param name="entry">The entry to test.</param> public static void CheckCartEntryWasProcessedByRule(this SkuCartEntry entry) { Assert.NotNull(entry.PromotionRuleId); Assert.NotNull(entry.Description); }