Ejemplo n.º 1
0
        public async System.Threading.Tasks.Task GetAll_ShouldReturnStatics()
        {
            // Arrange
            StatsDto statsDto = new StatsDtoStub().GetOnPosition(0);

            mutantServiceMock.Setup(x => x.GetStats()).ReturnsAsync(statsDto);

            // Act
            IActionResult result = await statsController.All();

            // Assert
            Assert.Equal(typeof(OkObjectResult), result.GetType());
            OkObjectResult okResult = (OkObjectResult)result;

            Assert.Equal(typeof(StatsDto), okResult.Value.GetType());
            var resultValues = (StatsDto)okResult.Value;

            Assert.Equal(resultValues, statsDto);
        }