public void RemoveFileDataAsyncThrowsNotFoundExceptionIfEntityDoesNotExistTest()
        {
            var mockUnitOfWork = new Mock<IUnitOfWork>();
            var mockLoggerService = new Mock<ILoggerService>();

            mockUnitOfWork.Setup(x => x.Repository<FileBlob>().GetAsync(It.IsAny<Expression<Func<FileBlob, bool>>>()))
                .Returns(() => Task.FromResult<FileBlob>(null));

            var persistenceService = new FilesPersistenceService(mockUnitOfWork.Object, mockLoggerService.Object);

            Assert.Throws<NotFoundException>(async () => await persistenceService.DeleteFileDataAsync(It.IsAny<Guid>()));
        }
        public async Task RemoveFileDataAsyncCallsCorrectUnitOfWorkMethodsTest()
        {
            var entity = new FileBlob();

            var mockUnitOfWork = new Mock<IUnitOfWork>();
            var mockLoggerService = new Mock<ILoggerService>();

            mockUnitOfWork.Setup(x => x.Repository<FileBlob>().GetAsync(It.IsAny<Expression<Func<FileBlob, bool>>>()))
                .Returns(() => Task.FromResult(entity));

            var persistenceService = new FilesPersistenceService(mockUnitOfWork.Object, mockLoggerService.Object);
            await persistenceService.DeleteFileDataAsync(It.IsAny<Guid>());

            mockUnitOfWork.Verify(m => m.Repository<FileBlob>().Remove(entity), Times.Once);
            mockUnitOfWork.Verify(m => m.SaveChanges(), Times.Once);
        }