コード例 #1
0
        public async Task AddDocumentAsync_ReturnsRegionDocumentDTO()
        {
            // Arrange

            RegionDocumentDTO doc = new RegionDocumentDTO()
            {
                ID = 2, BlobName = "Some, book", FileName = "Some.FileName"
            };
            RegionDocuments regionDocuments = new RegionDocuments()
            {
                ID = 2, BlobName = "Some, book", FileName = "Some.FileName"
            };

            _mapper.Setup(x => x.Map <RegionDocumentDTO, RegionDocuments>(doc))
            .Returns(regionDocuments);
            _repoWrapper.Setup(x => x.RegionDocument.Attach(regionDocuments));
            // Act
            var result = await _regionService.AddDocumentAsync(doc);

            // Assert
            Assert.IsInstanceOf <RegionDocumentDTO>(result);
            Assert.IsNotNull(result);
        }