示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
 public void GetTeamDoesNotExists()
 {
     TeamServices services  = new TeamServices(login, teamRepository, sportRepository, userRepository);
     TeamDTO      recovered = services.GetTeam("Boca");
 }
 public ActionResult Index()
 {
     return(View(_teamService.GetTeam()));
 }