public async Task ExecutesOkWithBodyFeatureThrowsException() { var kernelContainer = new FakeKernelContainer(); var request = new FakeHttpRequest <string>("Test"); var result = await ExecuteFeature.ExecuteOkWithBody <OkWithBodyFeatureWithException, string, string>(kernelContainer, request, (f, b) => f.Execute(b)); Assert.That(result.GetType(), Is.EqualTo(typeof(InternalServerErrorResult))); request.Dispose(); }
public async Task ExecutesOkWithBodyFeature() { var kernelContainer = new FakeKernelContainer(); var fakeService = kernelContainer.Kernel.Get <IFakeService>(); var request = new FakeHttpRequest <string>("Test"); var result = await ExecuteFeature.ExecuteOkWithBody <OkWithBodyFeature, string, string>(kernelContainer, request, (f, b) => f.Execute(b)) as OkObjectResult; Assert.That(fakeService.Value, Is.EqualTo("Test")); Assert.That(result, Is.Not.Null); Assert.That(result.Value, Is.EqualTo("Bla")); request.Dispose(); }