public async Task DeleteTest() { var fakeRepository = Mock.Of <IMatchRepository>(); var playerService = new MatchServices(fakeRepository); var player = new Match() { MatchId = 2 }; await playerService.Delete(player); }
public async Task EditTest() { var fakeRepository = Mock.Of <IMatchRepository>(); var playerService = new MatchServices(fakeRepository); var player = new Match() { MatchId = 3 }; await playerService.Edit(player); }
public async Task GetMatchTest() { int Matchid = 1; var Match = new Match() { MatchId = Matchid }; var fakeRepositoryMock = new Mock <IMatchRepository>(); fakeRepositoryMock.Setup(x => x.GetMatch(Matchid)).ReturnsAsync(Match); var MatchService = new MatchServices(fakeRepositoryMock.Object); var resultMatch = await MatchService.GetMatch(Matchid); Assert.Equal(Matchid, resultMatch.MatchId); }