Skip to content

Commit e7f5bb8

Browse files
author
CaseyBurns
committed
Created nuget package
1 parent 666e6b4 commit e7f5bb8

21 files changed

+592
-21
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
*.suo
44
*.user
55
test-results
6+
*.pidb
7+
*.userprefs

src/FluentAssertions.Mvc.Tests/ControllerAssertions_Tests.cs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,25 @@ namespace FluentAssertions.Mvc.Tests
99
public class ActionResultAssertions_Tests
1010
{
1111
[Test]
12-
public void BeView_GivenView_ShouldPass()
12+
public void BeView_GivenViewResult_ShouldPass ()
1313
{
14-
var controller = new FakeController (new ViewResult ());
15-
controller.Index().Should().BeView();
14+
var controller = new FakeController (new ViewResult ());
15+
controller.Index ().Should ().BeView ();
16+
}
17+
18+
[Test]
19+
public void BeView_GivenViewResultWithExpectedName_ShouldPass ()
20+
{
21+
var controller = new FakeController (new ViewResult { ViewName = "Index"});
22+
controller.Index ().Should ().BeView ();
23+
}
24+
25+
[Test]
26+
public void BeView_GivenRedirection_ShouldFail ()
27+
{
28+
var controller = new FakeController (new RedirectResult ("/"));
29+
Action action = () => controller.Index ().Should ().BeView ();
30+
action.ShouldThrow<AssertionException> ().WithMessage ("Expected ActionResult to be ViewResult but was \"RedirectResult\"");
1631
}
1732
}
1833
}

src/FluentAssertions.Mvc.Tests/FluentAssertions.Mvc.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@
5454
<Folder Include="Fakes\" />
5555
</ItemGroup>
5656
<ItemGroup>
57-
<ProjectReference Include="..\FluentAssertions.Mvc\FluentAssertions.Mvc.csproj">
57+
<ProjectReference Include="..\FluentAssertions.Mvc3\FluentAssertions.Mvc3.csproj">
5858
<Project>{53589F79-0908-409A-8366-3E18DC637600}</Project>
59-
<Name>FluentAssertions.Mvc</Name>
59+
<Name>FluentAssertions.Mvc3</Name>
6060
</ProjectReference>
6161
</ItemGroup>
6262
</Project>

src/FluentAssertions.Mvc.Tests/test-results/FluentAssertions.Mvc.Tests.csproj-Debug-2012-03-08.xml

Lines changed: 432 additions & 0 deletions
Large diffs are not rendered by default.

src/FluentAssertions.Mvc.sln

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

22
Microsoft Visual Studio Solution File, Format Version 11.00
33
# Visual Studio 2010
4-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentAssertions.Mvc", "FluentAssertions.Mvc\FluentAssertions.Mvc.csproj", "{53589F79-0908-409A-8366-3E18DC637600}"
5-
EndProject
64
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentAssertions.Mvc.Tests", "FluentAssertions.Mvc.Tests\FluentAssertions.Mvc.Tests.csproj", "{3CB00FF9-3DC2-460F-82E8-EBFB6339247D}"
75
EndProject
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentAssertions.Mvc3", "FluentAssertions.Mvc3\FluentAssertions.Mvc3.csproj", "{53589F79-0908-409A-8366-3E18DC637600}"
7+
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|Any CPU = Debug|Any CPU
@@ -21,6 +21,6 @@ Global
2121
{53589F79-0908-409A-8366-3E18DC637600}.Release|Any CPU.Build.0 = Release|Any CPU
2222
EndGlobalSection
2323
GlobalSection(MonoDevelopProperties) = preSolution
24-
StartupItem = FluentAssertions.Mvc\FluentAssertions.Mvc.csproj
24+
StartupItem = FluentAssertions.Mvc3\FluentAssertions.Mvc3.csproj
2525
EndGlobalSection
2626
EndGlobal

src/FluentAssertions.Mvc.userprefs

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,33 @@
11
<Properties>
2-
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
3-
<MonoDevelop.Ide.Workbench ActiveDocument="FluentAssertions.Mvc\AssemblyInfo.cs">
2+
<MonoDevelop.Ide.Workspace ActiveConfiguration="Release" />
3+
<MonoDevelop.Ide.Workbench ActiveDocument="FluentAssertions.Mvc.Tests\ControllerAssertions_Tests.cs">
44
<Files>
5-
<File FileName="FluentAssertions.Mvc\AssemblyInfo.cs" Line="28" Column="1" />
5+
<File FileName="FluentAssertions.Mvc.Tests\ControllerAssertions_Tests.cs" Line="5" Column="1" />
66
</Files>
7+
<Pads>
8+
<Pad Id="ProjectPad">
9+
<State expanded="True">
10+
<Option id="ShowAllFiles" value="False" />
11+
<Option id="ShowVersionControlOverlays" value="True" />
12+
<Node name="FluentAssertions.Mvc3" expanded="True" selected="True" />
13+
</State>
14+
</Pad>
15+
<Pad Id="ClassPad">
16+
<State expanded="True" selected="True" />
17+
</Pad>
18+
<Pad Id="MonoDevelop.Debugger.WatchPad">
19+
<State />
20+
</Pad>
21+
<Pad Id="MonoDevelop.NUnit.TestPad">
22+
<State expanded="True" selected="True" />
23+
</Pad>
24+
</Pads>
725
</MonoDevelop.Ide.Workbench>
826
<MonoDevelop.Ide.DebuggingService.Breakpoints>
9-
<BreakpointStore />
27+
<BreakpointStore>
28+
<Catchpoint exceptionName="NUnit.Framework.AssertionException" />
29+
<Breakpoint file="D:\Development\Projects\FluentAssertions.MVC\src\FluentAssertions.Mvc.Tests\ControllerAssertions_Tests.cs" line="58" />
30+
</BreakpointStore>
1031
</MonoDevelop.Ide.DebuggingService.Breakpoints>
1132
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
1233
</Properties>
-5.5 KB
Binary file not shown.

src/FluentAssertions.Mvc/ActionResultAssertions.cs renamed to src/FluentAssertions.Mvc3/ActionResultAssertions.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ public ActionResultAssertions (ActionResult subject)
1111
Subject = subject;
1212
}
1313

14-
public AndConstraint<ActionResultAssertions> BeView()
14+
public AndConstraint<ActionResultAssertions> BeView ()
1515
{
16-
var andConstraint = BeView(string.Empty, new object[] { });
16+
var andConstraint = BeView (string.Empty, new object[] { });
1717
return andConstraint;
1818
}
1919

20-
public AndConstraint<ActionResultAssertions> BeView(string reason, params object [] reasonArgs)
20+
public AndConstraint<ActionResultAssertions> BeView (string reason, params object [] reasonArgs)
2121
{
2222
Execute.Verification
23-
.ForCondition(Subject is ViewResult)
24-
.BecauseOf(reason, reasonArgs)
25-
.FailWith("Expected ActionResult to be View but was {0}", Subject.GetType().Name);
23+
.ForCondition (Subject is ViewResult)
24+
.BecauseOf (reason, reasonArgs)
25+
.FailWith ("Expected ActionResult to be View but was {0}", Subject.GetType ().Name);
2626

2727
return new AndConstraint<ActionResultAssertions> (this);
2828
}
File renamed without changes.

0 commit comments

Comments
 (0)