Skip to content
Browse files

Fix for issue #258

  • Loading branch information...
1 parent d8557cf commit 346a1379c09eb3324b3ad8b6e980f78d81735d0a @grumpydev grumpydev committed Sep 30, 2011
View
3 src/Nancy.Hosting.Owin.Tests/Nancy.Hosting.Owin.Tests.csproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -99,6 +99,7 @@
<Compile Include="Fakes\FakeConsumer.cs" />
<Compile Include="Fakes\FakeProducer.cs" />
<Compile Include="NancyOwinHostFixture.cs" />
+ <Compile Include="ResponseStreamFixture.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Nancy.Demo.Hosting.Owin\Nancy.Demo.Hosting.Owin.csproj">
View
18 src/Nancy.Hosting.Owin.Tests/ResponseStreamFixture.cs
@@ -0,0 +1,18 @@
+namespace Nancy.Tests
+{
+ using Nancy.Hosting.Owin;
+
+ using Xunit;
+
+ public class ResponseStreamFixture
+ {
+ [Fact]
+ public void Should_be_idempotent_when_calling_dispose()
+ {
+ var stream = new ResponseStream((arr, act) => false, () => { });
+
+ stream.Dispose();
+ stream.Dispose();
+ }
+ }
+}
View
2 src/Nancy.Hosting.Owin/ResponseStream.cs
@@ -57,7 +57,7 @@ public override void Close()
{
if (this.isCompleted)
{
- throw new InvalidOperationException("Stream is already closed");
+ return;
}
this.isCompleted = true;

0 comments on commit 346a137

Please sign in to comment.
Something went wrong with that request. Please try again.