Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }