Exemple #1
0
        public async void GetDocumentForAccount_ShouldCallService()
        {
            // Arrange
            _mockService.Setup(_ => _.GetDocumentForAccount(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>()))
            .ReturnsAsync(new byte[5]);

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

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

            Assert.NotNull(actionResult);
        }