示例#1
0
        public void ReturnRanking_Success()
        {
            //Arrange
            int competitionId = 2021;
            var ranking       = new Ranking()
            {
                Competition = new Competition {
                    Id = competitionId
                }
            };

            _rankingHandler.Setup(s => s.GetRanking(It.IsAny <CompetionRankingCommand>()))
            .Returns(ranking);

            //Act
            var result = _controllerTest.Get(competitionId);

            //Assert
            Assert.IsInstanceOfType(result, typeof(OkObjectResult));

            //var rank = (((OkObjectResult)result)?.Value as dynamic)?.data;

            //Assert.IsInstanceOfType(rank, typeof(Ranking));

            //var rankObj = rank as Ranking;

            //Assert.AreEqual(ranking.Competition.Id, rankObj.Competition.Id);
        }
示例#2
0
        public void Awards()
        {
            // Arrange
            RankingController controller = new RankingController();

            // Act
            RankingDTO result = controller.Get();

            // Assert
            Assert.IsNotNull(result.Awards);
        }
示例#3
0
        public void RankingTemPartida()
        {
            // Arrange
            RankingController controller = new RankingController();

            // Act
            RankingDTO result = controller.Get();

            // Assert
            Assert.IsTrue(result.MatchId > 0);
        }
示例#4
0
        public void ObterRanking()
        {
            // Arrange
            RankingController controller = new RankingController();

            // Act
            RankingDTO result = controller.Get();

            // Assert
            Assert.IsNotNull(result);
        }
示例#5
0
        public void RankingTemPersonagens()
        {
            // Arrange
            RankingController controller = new RankingController();

            // Act
            RankingDTO result = controller.Get();

            // Assert
            Assert.IsNotNull(result.RankingItens);
            Assert.IsTrue(result.RankingItens.All(x => x.PlayerId > 0));
        }
示例#6
0
        public void RankingTemKillsOuDeaths()
        {
            // Arrange
            RankingController controller = new RankingController();

            // Act
            RankingDTO result = controller.Get();

            // Assert
            Assert.IsNotNull(result.RankingItens);

            Assert.IsTrue(result.RankingItens.Any(x => x.Kills > 0 || x.Deaths > 0));
        }
示例#7
0
 public void OnGet()
 {
     Results = ((JsonResult)_controller.Get()).Value as RankingController.RankingResult;
 }