Exemplo n.º 1
0
        public async void GetAllTransactionsForYear_ShouldReturn200()
        {
            // Arrange
            _mockService.Setup(_ => _.GetAllTransactionsForYear(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <int>()))
            .ReturnsAsync(It.IsAny <List <Transaction> >());

            // Act
            var result = await _controller.GetAllTransactionsForYear(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <int>());

            // Assert
            _mockService.Verify(_ => _.GetAllTransactionsForYear(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <int>()), Times.Once);
            var actionResult = Assert.IsType <OkObjectResult>(result);

            Assert.Equal(200, actionResult.StatusCode);
        }