예제 #1
0
        public void RepoLeagueTestsRemovePosts()
        {
            Posts p = new Posts {
                PostsID = 0, Author = new Gamer(), Content = "Hi"
            };
            List <League> l = new List <League>
            {
                new League {
                    LeagueID = 0, GameTitle = "Halo", MaxPlayers = 2, Feed = new List <Posts> {
                        p
                    }
                }
            };

            _leagueSet.Object.AddRange(l);
            ConnectMocksToDataStore(l);
            bool          result   = _repo.RemovePostFromLeague(0, p);
            List <League> actual   = _repo.GetAllLeagues();
            List <League> expected = new List <League>
            {
                new League {
                    LeagueID = 0, GameTitle = "Halo", MaxPlayers = 2, Feed = new List <Posts>()
                }
            };

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