コード例 #1
0
        public void SetResultNoDataAccessTest()
        {
            Mock <IEncounterRepository> fakeRepo = new Mock <IEncounterRepository>();

            fakeRepo.Setup(r => r.Get(It.IsAny <int>())).Throws(new DataInaccessibleException());
            serviceToTest = new EncounterService(fakeRepo.Object, teamsRepo, sportsRepo, usersRepo, auth.Object);

            sportsRepo.Add(sport);
            teamsRepo.Add(teamA);
            teamsRepo.Add(teamB);

            ICollection <Tuple <int, int> > standings = GetFakeResult();
            ResultDto result = new ResultDto()
            {
                teams_positions = standings
            };

            serviceToTest.SetResult(matchAvsB.Id, result);
        }