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); }
public void Awards() { // Arrange RankingController controller = new RankingController(); // Act RankingDTO result = controller.Get(); // Assert Assert.IsNotNull(result.Awards); }
public void RankingTemPartida() { // Arrange RankingController controller = new RankingController(); // Act RankingDTO result = controller.Get(); // Assert Assert.IsTrue(result.MatchId > 0); }
public void ObterRanking() { // Arrange RankingController controller = new RankingController(); // Act RankingDTO result = controller.Get(); // Assert Assert.IsNotNull(result); }
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)); }
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)); }
public void OnGet() { Results = ((JsonResult)_controller.Get()).Value as RankingController.RankingResult; }