public async Task GetFormDataAsyncMethodReturnsCorrectTypeTest() { var formDataId = Guid.NewGuid(); var mockFormsPersistenceService = new Mock<IFormsPersistenceService>(); var persistenceController = new FormsPersistenceController(mockFormsPersistenceService.Object); var result = await persistenceController.GetFormDataAsync(formDataId); Assert.AreEqual(typeof(OkNegotiatedContentResult<string>), result.GetType()); }
public async Task GetFormDataAsyncMethodCallsCorrectServiceMethodTest() { var formDataId = Guid.NewGuid(); var mockFormsPersistenceService = new Mock<IFormsPersistenceService>(); var persistenceController = new FormsPersistenceController(mockFormsPersistenceService.Object); await persistenceController.GetFormDataAsync(formDataId); mockFormsPersistenceService.Verify(m => m.GetFormDataAsync(formDataId), Times.Once()); }