public void GetPlayerRanking_ShouldReturnPoints() { string playerId = "player1"; _rankingService.GetPlayerPoints(playerId, Common.Models.GameType.KalamburyGame).Returns(1); _controller = CreateController(); ActionResult <int> actionResult = _controller.GetPlayerRanking(playerId); Assert.IsInstanceOf <OkObjectResult>(actionResult.Result); OkObjectResult okObjectResult = actionResult.Result as OkObjectResult; Assert.IsInstanceOf <int>(okObjectResult.Value); var model = (int)okObjectResult.Value; Assert.IsNotNull(model); Assert.AreEqual(1, model); }
public ActionResult GetPlayerRanking(string playerId) { return(Ok(rankingService.GetPlayerPoints(playerId, GameType))); }