예제 #1
0
        public void RepoTeamInviteTestsUpdateAccepted()
        {
            Gamer g = new Gamer {
                GamerID = 0
            };
            Gamer g2 = new Gamer {
                GamerID = 1
            };
            MainTeam t = new MainTeam {
                MainTeamID = 0
            };

            List <TeamInvite> inviteDB = new List <TeamInvite>
            {
                new TeamInvite {
                    TeamInviteID = 0, Team = t, InvitedGamer = g, Accepted = false
                },
                new TeamInvite {
                    TeamInviteID = 1, Team = t, InvitedGamer = g2, Accepted = false
                },
            };

            _inviteSet.Object.AddRange(inviteDB);
            ConnectMocksToDataStore(inviteDB);

            TeamInvite expected = new TeamInvite {
                TeamInviteID = 0, Team = t, InvitedGamer = g, Accepted = true
            };
            bool       result = _repo.UpdateTeamInviteAccepted(0, true);
            TeamInvite actual = _repo.GetTeamInviteById(0);

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