public void GetTeamOk() { TeamServices services = new TeamServices(login, teamRepository, sportRepository, userRepository); Team boca = new Team("Boca", new Sport("Futbol")); teamRepository.Add(boca); TeamDTO recovered = services.GetTeam("Boca_Futbol"); Assert.AreEqual((string)boca.Name, recovered.Name); }
public async Task GetTeamTest() { int Teamid = 1; var Team = new Team() { TeamId = Teamid }; var fakeRepositoryMock = new Mock <IteamRepository>(); fakeRepositoryMock.Setup(x => x.GetTeam(Teamid)).ReturnsAsync(Team); var TeamService = new TeamServices(fakeRepositoryMock.Object); var resultTeam = await TeamService.GetTeam(Teamid); Assert.Equal(Teamid, resultTeam.TeamId); }
public void GetTeamDoesNotExists() { TeamServices services = new TeamServices(login, teamRepository, sportRepository, userRepository); TeamDTO recovered = services.GetTeam("Boca"); }
public ActionResult Index() { return(View(_teamService.GetTeam())); }