public async Task GetFilesDataAsyncMethodReturnsCorrectTypeTest() { var fileDataId = Guid.NewGuid(); var mockFilesPersistenceService = new Mock<IFilesPersistenceService>(); var persistenceController = new FilesPersistenceController(mockFilesPersistenceService.Object); var result = await persistenceController.GetFileDataAsync(fileDataId); Assert.AreEqual(typeof(OkNegotiatedContentResult<FilePersistenceServiceResponseDto>), result.GetType()); }
public async Task GetFilesDataAsyncMethodCallsCorrectServiceMethodTest() { var fileDataId = Guid.NewGuid(); var mockFilesPersistenceService = new Mock<IFilesPersistenceService>(); var persistenceController = new FilesPersistenceController(mockFilesPersistenceService.Object); await persistenceController.GetFileDataAsync(fileDataId); mockFilesPersistenceService.Verify(m => m.GetFileDataAsync(fileDataId), Times.Once()); }