public async Task ExecutesVoidWithBodyFeatureThrowsException() { var kernelContainer = new FakeKernelContainer(); var request = new FakeHttpRequest <string>("Test"); var result = await ExecuteFeature.ExecuteVoidWithBody <VoidWithBodyFeatureWithException, string>(kernelContainer, request, (f, b) => f.Execute(b)); Assert.That(result.GetType(), Is.EqualTo(typeof(InternalServerErrorResult))); request.Dispose(); }
public async Task ExecutesVoidWithBodyFeature() { var kernelContainer = new FakeKernelContainer(); var fakeService = kernelContainer.Kernel.Get <IFakeService>(); var request = new FakeHttpRequest <string>("Test"); var result = await ExecuteFeature.ExecuteVoidWithBody <VoidWithBodyFeature, string>(kernelContainer, request, (f, b) => f.Execute(b)) as OkResult; Assert.That(fakeService.Value, Is.EqualTo("Test")); Assert.That(result, Is.Not.Null); request.Dispose(); }