Example #1
0
        public async Task <IActionResult> Edit(int id, [Bind("ScoreStatisticId,Score,Numberofpenalty,NumberofyellowCard,Numberofredcard,MatchId")] ScoreStatistic scoreStatistic)
        {
            if (id != scoreStatistic.ScoreStatisticId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(scoreStatistic);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ScoreStatisticExists(scoreStatistic.ScoreStatisticId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["MatchId"] = new SelectList(_context.Match, "MatchId", "MatchId", scoreStatistic.MatchId);
            return(View(scoreStatistic));
        }
Example #2
0
 public async Task DeleteTest()
 {
     var fakeRepository = Mock.Of <IScoreStatisticRepository>();
     var playerService  = new ScoreStatisticServices(fakeRepository);
     var player         = new ScoreStatistic()
     {
         ScoreStatisticId = 2
     };
     await playerService.Delete(player);
 }
Example #3
0
 private async Task CreateTest()
 {
     var fakeRepository = Mock.Of <IScoreStatisticRepository>();
     var playerService  = new ScoreStatisticServices(fakeRepository);
     var player         = new ScoreStatistic()
     {
         ScoreStatisticId = 3
     };
     await playerService.AddAndSave(player);
 }
Example #4
0
        public async Task <IActionResult> Create([Bind("ScoreStatisticId,Score,Numberofpenalty,NumberofyellowCard,Numberofredcard,MatchId")] ScoreStatistic scoreStatistic)
        {
            if (ModelState.IsValid)
            {
                _context.Add(scoreStatistic);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["MatchId"] = new SelectList(_context.Match, "MatchId", "MatchId", scoreStatistic.MatchId);
            return(View(scoreStatistic));
        }
Example #5
0
    void Reset()
    {
        scoreText.GetComponent <Text>().text  = "Score: 0\n";
        scoreText.GetComponent <Text>().text += " Acc.: 100%\n";
        scoreText.GetComponent <Text>().text += " Acc. Score: 1000000\n";
        scoreText.GetComponent <Text>().text += " Max Combo: 0\n";

        judgeText.GetComponent <Text>().text  = " Perfect: 0\n";
        judgeText.GetComponent <Text>().text += " Good: 0\n";
        judgeText.GetComponent <Text>().text += " Bad: 0\n";
        judgeText.GetComponent <Text>().text += " Miss: 0\n";

        statistic = null;
    }
Example #6
0
        public async Task GetScoreStatisticTest()
        {
            int ScoreStatisticid = 1;
            var ScoreStatistic   = new ScoreStatistic()
            {
                ScoreStatisticId = ScoreStatisticid
            };

            var fakeRepositoryMock = new Mock <IScoreStatisticRepository>();

            fakeRepositoryMock.Setup(x => x.GetScoreStatistic(ScoreStatisticid)).ReturnsAsync(ScoreStatistic);

            var ScoreStatisticService = new ScoreStatisticServices(fakeRepositoryMock.Object);

            var resultScoreStatistic = await ScoreStatisticService.GetScoreStatistic(ScoreStatisticid);

            Assert.Equal(ScoreStatisticid, resultScoreStatistic.ScoreStatisticId);
        }
 public async Task Delete(ScoreStatistic ScoreStatistic)
 {
     _ScoreStatistics.Delete(ScoreStatistic);
     await _ScoreStatistics.Save();
 }
 public async Task Edit(ScoreStatistic ScoreStatistic)
 {
     _ScoreStatistics.Edit(ScoreStatistic);
     await _ScoreStatistics.Save();
 }
 public async Task AddAndSave(ScoreStatistic ScoreStatistic)
 {
     _ScoreStatistics.Add(ScoreStatistic);
     await _ScoreStatistics.Save();
 }
Example #10
0
 public void Set()
 {
     statistic = new ScoreStatistic();
 }
Example #11
0
 public void Edit(ScoreStatistic ScoreStatistic)
 {
     _context.Update(ScoreStatistic);
 }
Example #12
0
 public void Delete(ScoreStatistic ScoreStatistic)
 {
     _context.Remove(ScoreStatistic);
 }
Example #13
0
 public void Add(ScoreStatistic ScoreStatistic)
 {
     _context.Add(ScoreStatistic);
 }