Esempio n. 1
0
        public async Task AddDocument_Valid_Test()
        {
            // Arrange
            CityDocumentsViewModel document = new CityDocumentsViewModel();

            _mapper
            .Setup(m => m.Map <CityDocumentsViewModel, CityDocumentsDTO>(It.IsAny <CityDocumentsViewModel>()))
            .Returns(new CityDocumentsDTO());
            _cityDocumentsService
            .Setup(c => c.AddDocumentAsync(It.IsAny <CityDocumentsDTO>()));
            _logger
            .Setup(l => l.LogInformation(It.IsAny <string>()));
            CitiesController citycon = CreateCityController;

            // Act
            var result = await citycon.AddDocument(document);

            // Assert
            Assert.NotNull(result);
            Assert.IsInstanceOf <OkObjectResult>(result);
        }