Skip to content

Commit 50e7254

Browse files
committed
Fixed Mvc 5 / Web 4.5 compatibility
1 parent 90426cb commit 50e7254

File tree

3 files changed

+96
-19
lines changed

3 files changed

+96
-19
lines changed

src/FluentAssertions.Mvc3/Fakes/FakeHttpContext.cs

+82-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
using System;
2-
using System.IO;
32
using System.Web;
4-
using System.Web.Hosting;
53

64
namespace FluentAssertions.Mvc.Fakes
75
{
@@ -37,12 +35,91 @@ public override object GetService(Type serviceType)
3735
return new FakeHttpWorkerRequest();
3836
}
3937

40-
class FakeHttpWorkerRequest : SimpleWorkerRequest
38+
class FakeHttpWorkerRequest : HttpWorkerRequest
4139
{
42-
public FakeHttpWorkerRequest()
43-
: base(null, null, new StringWriter())
40+
public override string GetUriPath()
4441
{
42+
throw new NotImplementedException();
43+
}
44+
45+
public override string GetQueryString()
46+
{
47+
throw new NotImplementedException();
48+
}
49+
50+
public override string GetRawUrl()
51+
{
52+
throw new NotImplementedException();
53+
}
54+
55+
public override string GetHttpVerbName()
56+
{
57+
throw new NotImplementedException();
58+
}
59+
60+
public override string GetHttpVersion()
61+
{
62+
throw new NotImplementedException();
63+
}
64+
65+
public override string GetRemoteAddress()
66+
{
67+
throw new NotImplementedException();
68+
}
69+
70+
public override int GetRemotePort()
71+
{
72+
throw new NotImplementedException();
73+
}
74+
75+
public override string GetLocalAddress()
76+
{
77+
throw new NotImplementedException();
78+
}
4579

80+
public override int GetLocalPort()
81+
{
82+
throw new NotImplementedException();
83+
}
84+
85+
public override void SendStatus(int statusCode, string statusDescription)
86+
{
87+
throw new NotImplementedException();
88+
}
89+
90+
public override void SendKnownResponseHeader(int index, string value)
91+
{
92+
throw new NotImplementedException();
93+
}
94+
95+
public override void SendUnknownResponseHeader(string name, string value)
96+
{
97+
throw new NotImplementedException();
98+
}
99+
100+
public override void SendResponseFromMemory(byte[] data, int length)
101+
{
102+
throw new NotImplementedException();
103+
}
104+
105+
public override void SendResponseFromFile(string filename, long offset, long length)
106+
{
107+
throw new NotImplementedException();
108+
}
109+
110+
public override void SendResponseFromFile(IntPtr handle, long offset, long length)
111+
{
112+
throw new NotImplementedException();
113+
}
114+
115+
public override void FlushResponse(bool finalFlush)
116+
{
117+
throw new NotImplementedException();
118+
}
119+
120+
public override void EndOfRequest()
121+
{
122+
throw new NotImplementedException();
46123
}
47124
}
48125
}

src/FluentAssertions.Mvc5/FluentAssertions.Mvc5.csproj

+7-7
Original file line numberDiff line numberDiff line change
@@ -39,34 +39,34 @@
3939
</Reference>
4040
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
4141
<Private>True</Private>
42-
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
42+
<HintPath>..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
4343
</Reference>
4444
<Reference Include="System" />
4545
<Reference Include="System.Core" />
4646
<Reference Include="System.Web" />
4747
<Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
4848
<SpecificVersion>False</SpecificVersion>
49-
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.Helpers.dll</HintPath>
49+
<HintPath>..\..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.Helpers.dll</HintPath>
5050
</Reference>
5151
<Reference Include="System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
5252
<SpecificVersion>False</SpecificVersion>
53-
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.0.0\lib\net45\System.Web.Mvc.dll</HintPath>
53+
<HintPath>..\..\packages\Microsoft.AspNet.Mvc.5.0.0\lib\net45\System.Web.Mvc.dll</HintPath>
5454
</Reference>
5555
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
5656
<SpecificVersion>False</SpecificVersion>
57-
<HintPath>..\packages\Microsoft.AspNet.Razor.3.0.0\lib\net45\System.Web.Razor.dll</HintPath>
57+
<HintPath>..\..\packages\Microsoft.AspNet.Razor.3.0.0\lib\net45\System.Web.Razor.dll</HintPath>
5858
</Reference>
5959
<Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6060
<SpecificVersion>False</SpecificVersion>
61-
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.dll</HintPath>
61+
<HintPath>..\..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.dll</HintPath>
6262
</Reference>
6363
<Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6464
<SpecificVersion>False</SpecificVersion>
65-
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
65+
<HintPath>..\..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
6666
</Reference>
6767
<Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6868
<SpecificVersion>False</SpecificVersion>
69-
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
69+
<HintPath>..\..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
7070
</Reference>
7171
<Reference Include="System.Xml" />
7272
<Reference Include="System.Xml.Linq" />

tests/FluentAssertions.Mvc5.Tests/FluentAssertions.Mvc5.Tests.csproj

+7-7
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</Reference>
4242
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
4343
<Private>True</Private>
44-
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
44+
<HintPath>..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
4545
</Reference>
4646
<Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
4747
<SpecificVersion>False</SpecificVersion>
@@ -52,27 +52,27 @@
5252
<Reference Include="System.Web" />
5353
<Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
5454
<SpecificVersion>False</SpecificVersion>
55-
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.Helpers.dll</HintPath>
55+
<HintPath>..\..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.Helpers.dll</HintPath>
5656
</Reference>
5757
<Reference Include="System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
5858
<SpecificVersion>False</SpecificVersion>
59-
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.0.0\lib\net45\System.Web.Mvc.dll</HintPath>
59+
<HintPath>..\..\packages\Microsoft.AspNet.Mvc.5.0.0\lib\net45\System.Web.Mvc.dll</HintPath>
6060
</Reference>
6161
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6262
<SpecificVersion>False</SpecificVersion>
63-
<HintPath>..\packages\Microsoft.AspNet.Razor.3.0.0\lib\net45\System.Web.Razor.dll</HintPath>
63+
<HintPath>..\..\packages\Microsoft.AspNet.Razor.3.0.0\lib\net45\System.Web.Razor.dll</HintPath>
6464
</Reference>
6565
<Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6666
<SpecificVersion>False</SpecificVersion>
67-
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.dll</HintPath>
67+
<HintPath>..\..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.dll</HintPath>
6868
</Reference>
6969
<Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7070
<SpecificVersion>False</SpecificVersion>
71-
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
71+
<HintPath>..\..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
7272
</Reference>
7373
<Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7474
<SpecificVersion>False</SpecificVersion>
75-
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
75+
<HintPath>..\..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
7676
</Reference>
7777
<Reference Include="System.Xml" />
7878
<Reference Include="System.Xml.Linq" />

0 commit comments

Comments
 (0)