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

Commit 0b0f632

Browse files
committed
Removed net45 specific test
1 parent 36617b5 commit 0b0f632

1 file changed

Lines changed: 0 additions & 42 deletions

File tree

‎src/Nancy.Tests/Unit/NancyEngineFixture.cs‎

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -674,48 +674,6 @@ public void Should_add_requestexecutionexception_to_context_when_pipeline_is_nul
674674
result.Items["ERROR_EXCEPTION"].ShouldBeOfType<RequestExecutionException>();
675675
}
676676

677-
[Fact]
678-
public void Should_Not_Dispose_Cancellation_Token_Before_Task_is_complete()
679-
{
680-
// Given
681-
var resolvedRoute = new ResolveResult(
682-
new FakeRoute(),
683-
DynamicDictionary.Empty,
684-
null,
685-
null,
686-
null);
687-
688-
A.CallTo(() => resolver.Resolve(A<NancyContext>.Ignored)).Returns(resolvedRoute);
689-
690-
CancellationToken? cancellationToken = null;
691-
692-
A.CallTo(() => this.requestDispatcher.Dispatch(context, A<CancellationToken>._))
693-
.ReturnsLazily<Task<Response>, NancyContext, CancellationToken>((x, y) => Task.Run(async () =>
694-
{
695-
for (int i = 0; i < 2; i++)
696-
await Task.Delay(1, y);
697-
698-
cancellationToken = y;
699-
700-
return response;
701-
}));
702-
703-
704-
var pipelines = new Pipelines { OnError = null };
705-
engine.RequestPipelinesFactory = (ctx) => pipelines;
706-
707-
var request = new Request("GET", "/", "http");
708-
709-
// When
710-
var result = this.engine.HandleRequest(request);
711-
712-
// Then
713-
result.Items.Keys.Contains("ERROR_EXCEPTION").ShouldBeFalse();
714-
715-
var exception = Record.Exception(() => !cancellationToken.HasValue || cancellationToken.Value.WaitHandle != null);
716-
exception.ShouldBeOfType<ObjectDisposedException>();
717-
}
718-
719677
[Fact]
720678
public void Should_persist_original_exception_in_requestexecutionexception_when_pipeline_is_null()
721679
{

0 commit comments

Comments
 (0)