Beispiel #1
0
        public async Task GetFileAchievementBase64_ReturnsOkObjectResult()
        {
            // Arrange
            _mockBlankAchievementDocumentService
            .Setup(x => x.DownloadFileAsync(new string("Dogovir")))
            .ReturnsAsync(new string("Dogovir"));
            //Act
            var document = await _blanksController.GetFileAchievementBase64("Dogovir");

            OkObjectResult result = document as OkObjectResult;

            //Assert
            _mockBlankAchievementDocumentService.Verify();
            Assert.NotNull(document);
            Assert.IsInstanceOf <ObjectResult>(document);
            Assert.AreEqual("Dogovir", result.Value);
        }
        public async Task GetFileAchievementBase64_ReturnsOkObjectResult()
        {
            // Arrange
            _mockBlankAchievementDocumentService
            .Setup(x => x.DownloadFileAsync(It.IsAny <string>()))
            .ReturnsAsync(GetExtractFromUPUDocumentsDTO().FileName);

            //Act
            var document = await _blanksController.GetFileAchievementBase64(GetExtractFromUPUDocumentsDTO().FileName);

            OkObjectResult result = document as OkObjectResult;

            //Assert
            _mockBlankAchievementDocumentService.Verify();
            Assert.NotNull(document);
            Assert.IsInstanceOf <ObjectResult>(document);
            Assert.AreEqual(GetExtractFromUPUDocumentsDTO().FileName, result.Value);
        }