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 ExecutesVoidFeature()
        {
            var kernelContainer = new FakeKernelContainer();
            var fakeService     = kernelContainer.Kernel.Get <IFakeService>();

            var result = await ExecuteFeature.ExecuteVoid <VoidFeature>(kernelContainer, f => f.Execute("Test"));

            Assert.That(fakeService.Value, Is.EqualTo("Test"));
            Assert.That(result.GetType(), Is.EqualTo(typeof(OkResult)));
        }
        public async Task ExecutesActionWithBodyFeatureThrowsException()
        {
            var kernelContainer = new FakeKernelContainer();
            var request         = new FakeHttpRequest <string>("Test");

            var result =
                await ExecuteFeature.ExecuteActionWithBody <ActionWithBodyFeatureWithException, string>(kernelContainer, request, (f, b) => f.Execute(b));

            Assert.That(result.GetType(), Is.EqualTo(typeof(InternalServerErrorResult)));
            request.Dispose();
        }
        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"));
        }
        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();
        }