Exemple #1
0
        public void GeneratesACommissionForAgent()
        {
            var item = new Item {
                Id = 1, ItemType = ItemType.Book, Name = "someProduct"
            };

            var rule = new BookRule();

            var actual = rule.Apply(item);

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

            var rule = new BookRule();

            var actual = rule.Apply(item);

            Assert.Contains("Duplicate Slip generated for Royalty Dept", actual.Activity);
        }
Exemple #3
0
        public void ApplicationReturnsARuleLog()
        {
            var item = new Item {
                Id = 1, ItemType = ItemType.Book, Name = "someProduct"
            };

            var rule = new BookRule();

            var actual = rule.Apply(item);

            Assert.IsType(typeof(RuleLog), actual);
            Assert.Equal("Book Rule", actual.RuleName);
        }
Exemple #4
0
        public void ApplysForBook()
        {
            var item = new Item {
                Id = 1, ItemType = ItemType.Book, Name = "someProduct"
            };

            var rule = new BookRule();

            var actual = rule.Apply(item);

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