Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Commit

Permalink
Removed net45 specific test
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodejunkie committed Dec 14, 2015
1 parent 36617b5 commit 0b0f632
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions src/Nancy.Tests/Unit/NancyEngineFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -674,48 +674,6 @@ public void Should_add_requestexecutionexception_to_context_when_pipeline_is_nul
result.Items["ERROR_EXCEPTION"].ShouldBeOfType<RequestExecutionException>();
}

[Fact]
public void Should_Not_Dispose_Cancellation_Token_Before_Task_is_complete()
{
// Given
var resolvedRoute = new ResolveResult(
new FakeRoute(),
DynamicDictionary.Empty,
null,
null,
null);

A.CallTo(() => resolver.Resolve(A<NancyContext>.Ignored)).Returns(resolvedRoute);

CancellationToken? cancellationToken = null;

A.CallTo(() => this.requestDispatcher.Dispatch(context, A<CancellationToken>._))
.ReturnsLazily<Task<Response>, NancyContext, CancellationToken>((x, y) => Task.Run(async () =>
{
for (int i = 0; i < 2; i++)
await Task.Delay(1, y);

cancellationToken = y;

return response;
}));


var pipelines = new Pipelines { OnError = null };
engine.RequestPipelinesFactory = (ctx) => pipelines;

var request = new Request("GET", "/", "http");

// When
var result = this.engine.HandleRequest(request);

// Then
result.Items.Keys.Contains("ERROR_EXCEPTION").ShouldBeFalse();

var exception = Record.Exception(() => !cancellationToken.HasValue || cancellationToken.Value.WaitHandle != null);
exception.ShouldBeOfType<ObjectDisposedException>();
}

[Fact]
public void Should_persist_original_exception_in_requestexecutionexception_when_pipeline_is_null()
{
Expand Down

0 comments on commit 0b0f632

Please sign in to comment.