public async Task RemoveFileDataAsyncMethodReturnsCorrectTypeTest() { var fileDataId = Guid.NewGuid(); var mockFilesPersistenceService = new Mock <IFilesPersistenceService>(); var persistenceController = new FilesPersistenceController(mockFilesPersistenceService.Object); var result = await persistenceController.DeleteFileDataAsync(fileDataId); Assert.AreEqual(typeof(OkResult), result.GetType()); }
public async Task RemoveFileDataAsyncMethodCallsCorrectServiceMethodTest() { var fileDataId = Guid.NewGuid(); var mockFilesPersistenceService = new Mock <IFilesPersistenceService>(); var persistenceController = new FilesPersistenceController(mockFilesPersistenceService.Object); await persistenceController.DeleteFileDataAsync(fileDataId); mockFilesPersistenceService.Verify(m => m.DeleteFileDataAsync(fileDataId), Times.Once()); }