Exemple #1
0
 public async Task DeleteTest()
 {
     var fakeRepository = Mock.Of <IMatchRepository>();
     var playerService  = new MatchServices(fakeRepository);
     var player         = new Match()
     {
         MatchId = 2
     };
     await playerService.Delete(player);
 }
Exemple #2
0
 public async Task EditTest()
 {
     var fakeRepository = Mock.Of <IMatchRepository>();
     var playerService  = new MatchServices(fakeRepository);
     var player         = new Match()
     {
         MatchId = 3
     };
     await playerService.Edit(player);
 }
Exemple #3
0
        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);
        }