예제 #1
0
        public void RepositoryTestsEnsureICanGetAllPosts()
        {
            List <Posts> expected = new List <Posts>
            {
                new Posts {
                    PostsID = 1, Date = new DateTime(2015, 12, 2), Content = "What??"
                },
                new Posts {
                    PostsID = 2, Date = new DateTime(2015, 12, 5), Content = "Who??"
                }
            };


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

            var actual = _repo.GetAllPosts();

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