public async Task RemoveFormDataAsyncMethodReturnsCorrectTypeTest() { var formDataId = Guid.NewGuid(); var mockFormsPersistenceService = new Mock<IFormsPersistenceService>(); var persistenceController = new FormsPersistenceController(mockFormsPersistenceService.Object); var result = await persistenceController.RemoveFormDataAsync(formDataId); Assert.AreEqual(typeof(OkResult), result.GetType()); }
public async Task RemoveFormDataAsyncMethodCallsCorrectServiceMethodTest() { var formDataId = Guid.NewGuid(); var mockFormsPersistenceService = new Mock<IFormsPersistenceService>(); var persistenceController = new FormsPersistenceController(mockFormsPersistenceService.Object); await persistenceController.RemoveFormDataAsync(formDataId); mockFormsPersistenceService.Verify(m => m.RemoveFormDataAsync(formDataId), Times.Once()); }
public async Task SaveFormDataAsyncMethodCallsCorrectServiceMethodTest() { var formDataId = Guid.NewGuid(); var serializedObject = string.Empty; var mockFormsPersistenceService = new Mock<IFormsPersistenceService>(); var persistenceController = new FormsPersistenceController(mockFormsPersistenceService.Object); await persistenceController.SaveFormDataAsync(formDataId, serializedObject); mockFormsPersistenceService.Verify(m => m.SaveFormDataAsync(formDataId, serializedObject), Times.Once()); }