public async Task ExecutesOkFeatureThrowsException() { var kernelContainer = new FakeKernelContainer(); var result = await ExecuteFeature.ExecuteOk <OkFeatureWithException, string>(kernelContainer, f => f.Execute("Test")); Assert.That(result.GetType(), Is.EqualTo(typeof(InternalServerErrorResult))); }
public async Task ExecutesOkFeature() { var kernelContainer = new FakeKernelContainer(); var fakeService = kernelContainer.Kernel.Get <IFakeService>(); var result = await ExecuteFeature.ExecuteOk <OkFeature, string>(kernelContainer, f => f.Execute("Test")) as OkObjectResult; Assert.That(fakeService.Value, Is.EqualTo("Test")); Assert.That(result, Is.Not.Null); var resultContent = result.Value; Assert.That(resultContent, Is.EqualTo("Bla")); }