private IActionResult TryGetMatch(int matchId) { EncounterDto stored = encounterService.GetEncounter(matchId); EncounterModelOut modelOut = factory.CreateModelOut(stored); IActionResult result = Ok(modelOut); return(result); }
public void GetEncounterNoDataAccessTest() { 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); serviceToTest.GetEncounter(9); }
public void GetUnexistentMatchTest() { serviceToTest.GetEncounter(9); }
public IActionResult GetEncounter(int id) { return(Json(_encounterService.GetEncounter(id))); }