Esempio n. 1
0
        public void DeleteFileAsync_ReturnsCorrect()
        {
            // Arrange
            RegionDocuments doc = new RegionDocuments()
            {
                ID = 2, BlobName = "blobName"
            };

            _repoWrapper
            .Setup(x => x.RegionDocument
                   .GetFirstOrDefaultAsync(It.IsAny <Expression <Func <RegionDocuments, bool> > >(),
                                           It.IsAny <Func <IQueryable <RegionDocuments>, IIncludableQueryable <RegionDocuments, object> > >()))
            .ReturnsAsync(doc);

            _regionFilesBlobStorageRepository
            .Setup(x => x.DeleteBlobAsync(doc.BlobName));

            _repoWrapper
            .Setup(x => x.RegionDocument.Delete(doc));

            _repoWrapper
            .Setup(x => x.SaveAsync());
            // Act
            var result = _regionService.DeleteFileAsync(It.IsAny <int>());

            // Assert
            _repoWrapper.Verify();
            Assert.NotNull(result);
        }