Example #1
0
        public async Task GetMatchsTest()
        {
            var movies = new List <aspnetfirst.Models.Match>
            {
                new Match()
                {
                    MatchId = 4
                },
                new Match()
                {
                    MatchId = 5
                }
            };

            var fakeRepositoryMock = new Mock <IMatchRepository>();

            fakeRepositoryMock.Setup(x => x.GetAll()).ReturnsAsync(movies);


            var playerService = new MatchServices(fakeRepositoryMock.Object);

            var resultMatchs = await playerService.GetMatchs();

            Assert.Collection(resultMatchs, player =>
            {
                Assert.Equal(4, player.MatchId);
            },
                              player =>
            {
                Assert.Equal(5, player.MatchId);
            });
        }
Example #2
0
        public ActionResult Find(MatchModel parms)
        {
            MatchServices m = new MatchServices();

            parms.CompanyId = SessionWeb.User.CompanyId;

            var items = m.GetMatchProject(parms);

            return(Json(items, JsonRequestBehavior.AllowGet));
        }
Example #3
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);
 }
Example #4
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);
 }
Example #5
0
 private async Task CreateTest()
 {
     var fakeRepository = Mock.Of <IMatchRepository>();
     var playerService  = new MatchServices(fakeRepository);
     var player         = new aspnetfirst.Models.Match()
     {
         MatchId = 3
     };
     await playerService.AddAndSave(player);
 }
Example #6
0
        public void MatchExistsTest()
        {
            int MatchId = 1;

            var fakeRepositoryMock = new Mock <IMatchRepository>();

            fakeRepositoryMock.Setup(x => x.MatchExists(MatchId)).Returns(true);

            var MatchService = new MatchServices(fakeRepositoryMock.Object);

            var isExist = MatchService.MatchExists(MatchId);

            Assert.True(isExist);
        }
Example #7
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);
        }
Example #8
0
 public MatchController(IConfiguration configuration, MongoClient mongoClient)
 {
     _services = new MatchServices(configuration, mongoClient);
 }
 public MatchesController()
 {
     matchServices = new MatchServices();
     teamServices  = new TeamServices();
 }
 public CompetitionChartController()
 {
     service      = new CompetitionServices();
     matchservice = new MatchServices();
 }
Example #11
0
 public CronUtils(IConfiguration configuration, MongoClient mongoClient)
 {
     _statiticisServices = new StatiticsServices(configuration, mongoClient);
     _matchServices      = new MatchServices(configuration, mongoClient);
 }