Ejemplo n.º 1
0
        public void Test_NameFilter_Return_Rigth_Objects()
        {
            //arrange
            NameFilter filter = new NameFilter("Nam");

            //act
            var expression = filter.Execute(_startExpression);
            var games = _games.Where(expression.Compile()).ToList();

            //assert
            Assert.IsNotNull(games);
            Assert.AreEqual(1, games.Count);
            Assert.AreEqual(1, games[0].GameId);
        }
Ejemplo n.º 2
0
        public void Test_PipelineBuilder_Return_Right_Object()
        {
            //arrange
            NameFilter filter = new NameFilter("Nam");
            PipelineBuilder builder = new PipelineBuilder();

            //act
            var expression = builder.Execute( new List<IFilter> { filter });
            List<Game> games = _games.Where(expression.Compile()).ToList();

            //assert
            Assert.IsNotNull(games);
            Assert.AreEqual(1, games.Count);
            Assert.AreEqual(1, games[0].GameId);
        }