Exemple #1
0
        public void RepoTeamInviteTestsGetTeamInvitesByTeamID()
        {
            MainTeam mt = new MainTeam {
                MainTeamID = 0
            };
            TeamInvite invite = new TeamInvite {
                Team = mt, Accepted = true
            };
            TeamInvite invite2 = new TeamInvite {
                Team = mt, Accepted = false
            };
            List <TeamInvite> expected = new List <TeamInvite>
            {
                invite,
                invite2
            };
            List <TeamInvite> inviteDB = new List <TeamInvite>
            {
                invite,
                invite2,
                new TeamInvite {
                    Team = new MainTeam {
                        MainTeamID = 1
                    }
                }
            };

            _inviteSet.Object.AddRange(inviteDB);
            ConnectMocksToDataStore(inviteDB);
            List <TeamInvite> actual = _repo.getInvitesByTeamID(0);

            Assert.AreEqual(2, actual.Count);
            Assert.IsNotNull(_inviteSet.Object);
            CollectionAssert.AreEqual(expected, actual);
        }