Ejemplo n.º 1
0
        public void RepositoryTestsEnsureICanSearchPostsByContent()
        {
            List <Posts> expected = new List <Posts>
            {
                new Posts {
                    PostsID = 1, Date = new DateTime(2015, 12, 2), Content = "What is the name of the game??"
                },
                new Posts {
                    PostsID = 2, Date = new DateTime(2015, 12, 5), Content = "Who??"
                },
                new Posts {
                    PostsID = 3, Date = new DateTime(2015, 12, 7, 10, 15, 00), Content = "Game Game"
                }
            };


            _postSet.Object.AddRange(expected);
            ConnectMocksToDataStore(expected);

            var actual = _repo.SearchPostsByContent("game");

            Assert.AreEqual(2, actual.Count);
            Assert.AreEqual(3, actual[0].PostsID);
            Assert.AreEqual(1, actual[1].PostsID);
        }