Exemplo n.º 1
0
        public void Return_True()
        {
            //Arrange
            IDictionary <string, PriceModel> books = new Dictionary <string, PriceModel>();

            books.Add("Test", new PriceModel()
            {
                AvailableQuantity = 2,
                CategoryName      = "Test",
                HaveDiscount      = false,
                Price             = 4,
                Quantity          = 2
            });

            books.Add("Test2", new PriceModel()
            {
                AvailableQuantity = 2,
                CategoryName      = "Test",
                HaveDiscount      = false,
                Price             = 4,
                Quantity          = 2
            });

            var rule = new SeveralBooksRule();

            //Act
            var result = rule.MatchCondition(books);

            //Assert
            Assert.AreEqual(true, result);
        }