예제 #1
0
        public void RepoTeamInviteTestsUpdateDateAccepted()
        {
            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, DateAccepted = new DateTime(2016, 05, 01)
                },
                new TeamInvite {
                    TeamInviteID = 1, Team = t, InvitedGamer = g2, DateAccepted = new DateTime(2016, 05, 01)
                },
            };

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

            TeamInvite expected = new TeamInvite {
                TeamInviteID = 0, Team = t, InvitedGamer = g, DateAccepted = new DateTime(2016, 06, 02)
            };
            bool       result = _repo.UpdateTeamInviteDateAccepted(0, new DateTime(2016, 06, 02));
            TeamInvite actual = _repo.GetTeamInviteById(0);

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