Exemplo n.º 1
0
        public void Check_That_DateFilter_Returns_Right_Delegate_By_LastMonth()
        {
            // Arrange
            var container = new GameFilterContainer
            {
                Model = new GamesFilterModel
                {
                    DatePeriod = DatePeriod.LastMonth,
                }
            };

            var filter = new DateFilter();

            IEnumerable <Game> list = GetGamesList();

            // Act
            filter.Execute(container);
            Func <Game, bool> resultCondition = CombinePredicate <Game> .CombineWithAnd(container.Conditions);

            IEnumerable <Game> result = list.Where(x => (resultCondition(x)));

            // Assert
            Assert.IsTrue(result.Count() == 2);
        }