예제 #1
0
        public void RepoGamerTestsUpdateGamerComments()
        {
            List <Gamer> gamerdb = new List <Gamer>
            {
                new Gamer {
                    GamerID = 0, Active = true, Comments = new List <Posts>()
                },
                new Gamer {
                    GamerID = 1, Active = true
                }
            };
            Posts p = new Posts {
                PostsID = 0, Content = "Hi"
            };

            _gamerSet.Object.AddRange(gamerdb);
            ConnectMocksToDataStore(gamerdb);
            Gamer expected = new Gamer {
                GamerID = 0, Active = true, Comments = new List <Posts>()
            };

            expected.Comments.Add(p);
            bool  result = _repo.UpdateGamerComments(0, p);
            Gamer actual = _repo.GetGamerById(0);

            Assert.IsTrue(result);
            Assert.AreEqual(expected, actual);
        }