Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 /// <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);
 }
Beispiel #4
0
 /// <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);
 }