Skip to content

Commit 05bf93f

Browse files
committed
Merge branch 'fluent-assertions-2.1' into master
Conflicts: src/FluentAssertions.Mvc3/ContentResultAssertions.cs
2 parents 4ea2141 + b5edc1d commit 05bf93f

20 files changed

+59
-49
lines changed

samples/FluentAssertions.Mvc3.Samples/FluentAssertions.Mvc3.Samples.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@
4949
<Reference Include="EntityFramework">
5050
<HintPath>..\..\packages\EntityFramework.4.1.10331.0\lib\EntityFramework.dll</HintPath>
5151
</Reference>
52-
<Reference Include="FluentAssertions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
52+
<Reference Include="FluentAssertions, Version=2.1.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
5353
<SpecificVersion>False</SpecificVersion>
54-
<HintPath>..\..\packages\FluentAssertions.2.0.0.1\lib\net40\FluentAssertions.dll</HintPath>
54+
<HintPath>..\..\packages\FluentAssertions.2.1.0.0\lib\net40\FluentAssertions.dll</HintPath>
5555
</Reference>
5656
<Reference Include="nunit.framework, Version=2.6.0.12051, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
5757
<SpecificVersion>False</SpecificVersion>

samples/FluentAssertions.Mvc3.Samples/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="EntityFramework" version="4.1.10331.0" />
4-
<package id="FluentAssertions" version="2.0.0.1" targetFramework="net40" />
4+
<package id="FluentAssertions" version="2.1.0.0" targetFramework="net40" />
55
<package id="jQuery" version="1.5.1" />
66
<package id="jQuery.UI.Combined" version="1.8.11" />
77
<package id="jQuery.Validation" version="1.8.0" />

src/FluentAssertions.Mvc3/ActionResultAssertions.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public ContentResultAssertions BeContentResult()
4545
/// </param>
4646
public ContentResultAssertions BeContentResult(string reason, params object[] reasonArgs)
4747
{
48-
Execute.Verification
48+
Execute.Assertion
4949
.BecauseOf(reason, reasonArgs)
5050
.ForCondition(Subject is ContentResult)
5151
.FailWith(Constants.CommonFailMessage, typeof(ContentResult).Name, Subject.GetType().Name);
@@ -73,7 +73,7 @@ public EmptyResult BeEmptyResult()
7373
/// </param>
7474
public EmptyResult BeEmptyResult(string reason, params object[] reasonArgs)
7575
{
76-
Execute.Verification
76+
Execute.Assertion
7777
.BecauseOf(reason, reasonArgs)
7878
.ForCondition(Subject is EmptyResult)
7979
.FailWith(Constants.CommonFailMessage, typeof(EmptyResult).Name, Subject.GetType().Name);
@@ -101,7 +101,7 @@ public RedirectToRouteAssertions BeRedirectToRouteResult()
101101
/// </param>
102102
public RedirectToRouteAssertions BeRedirectToRouteResult(string reason, params object[] reasonArgs)
103103
{
104-
Execute.Verification
104+
Execute.Assertion
105105
.BecauseOf(reason, reasonArgs)
106106
.ForCondition(Subject is RedirectToRouteResult)
107107
.FailWith(Constants.CommonFailMessage, typeof(RedirectToRouteResult).Name, Subject.GetType().Name);
@@ -129,7 +129,7 @@ public PartialViewResultAssertions BePartialViewResult()
129129
/// </param>
130130
public PartialViewResultAssertions BePartialViewResult(string reason, params object[] reasonArgs)
131131
{
132-
Execute.Verification
132+
Execute.Assertion
133133
.BecauseOf(reason, reasonArgs)
134134
.ForCondition(Subject is PartialViewResult)
135135
.FailWith(Constants.CommonFailMessage, typeof(PartialViewResult).Name, Subject.GetType().Name);
@@ -157,7 +157,7 @@ public RedirectResultAssertions BeRedirectResult()
157157
/// </param>
158158
public RedirectResultAssertions BeRedirectResult(string reason, params object[] reasonArgs)
159159
{
160-
Execute.Verification
160+
Execute.Assertion
161161
.BecauseOf(reason, reasonArgs)
162162
.ForCondition(Subject is RedirectResult)
163163
.FailWith(Constants.CommonFailMessage, "RedirectResult", Subject.GetType().Name);
@@ -185,7 +185,7 @@ public ViewResultAssertions BeViewResult()
185185
/// </param>
186186
public ViewResultAssertions BeViewResult(string reason, params object[] reasonArgs)
187187
{
188-
Execute.Verification
188+
Execute.Assertion
189189
.BecauseOf(reason, reasonArgs)
190190
.ForCondition (Subject is ViewResult)
191191
.FailWith(Constants.CommonFailMessage, "ViewResult", Subject.GetType().Name);

src/FluentAssertions.Mvc3/ContentResultAssertions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public ContentResultAssertions WithContent(string expectedContent, string reason
3535
{
3636
string actualContent = (Subject as ContentResult).Content;
3737

38-
Execute.Verification
38+
Execute.Assertion
3939
.ForCondition(string.Equals(actualContent, expectedContent, StringComparison.InvariantCultureIgnoreCase))
4040
.BecauseOf(reason, reasonArgs)
4141
.FailWith(string.Format(FailureMessages.CommonFailMessage, "ContentResult.Content", expectedContent, actualContent));
@@ -58,7 +58,7 @@ public ContentResultAssertions WithContentType(string expectedContentType, strin
5858
{
5959
string actualContentType = (Subject as ContentResult).ContentType;
6060

61-
Execute.Verification
61+
Execute.Assertion
6262
.ForCondition(string.Equals(expectedContentType, actualContentType, StringComparison.InvariantCultureIgnoreCase))
6363
.BecauseOf(reason, reasonArgs)
6464
.FailWith(string.Format(FailureMessages.CommonFailMessage, "ContentResult.ContentType", expectedContentType, actualContentType));
@@ -81,7 +81,7 @@ public ContentResultAssertions WithContentEncoding(Encoding expectedEncoding, st
8181
{
8282
Encoding actualContentEncoding = (Subject as ContentResult).ContentEncoding;
8383

84-
Execute.Verification
84+
Execute.Assertion
8585
.ForCondition(expectedEncoding == actualContentEncoding)
8686
.BecauseOf(reason, reasonArgs)
8787
.FailWith(string.Format(FailureMessages.CommonFailMessage, "ContentResult.ContentEncoding", expectedEncoding.ToString(), actualContentEncoding.ToString()));

src/FluentAssertions.Mvc3/FluentAssertions.Mvc3.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
<DocumentationFile>..\..\bin\Release\FluentAssertions.Mvc3.XML</DocumentationFile>
4545
</PropertyGroup>
4646
<ItemGroup>
47-
<Reference Include="FluentAssertions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
47+
<Reference Include="FluentAssertions, Version=2.1.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
4848
<SpecificVersion>False</SpecificVersion>
49-
<HintPath>..\..\packages\FluentAssertions.2.0.0.1\lib\net40\FluentAssertions.dll</HintPath>
49+
<HintPath>..\..\packages\FluentAssertions.2.1.0.0\lib\net40\FluentAssertions.dll</HintPath>
5050
</Reference>
5151
<Reference Include="System" />
5252
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
@@ -83,15 +83,15 @@
8383
<Compile Include="ViewResultAssertions.cs" />
8484
<Compile Include="ViewResultBaseAssertions.cs" />
8585
</ItemGroup>
86-
<ItemGroup>
87-
<None Include="packages.config" />
88-
</ItemGroup>
8986
<ItemGroup>
9087
<EmbeddedResource Include="FailureMessages.resx">
9188
<Generator>ResXFileCodeGenerator</Generator>
9289
<LastGenOutput>FailureMessages.Designer.cs</LastGenOutput>
9390
</EmbeddedResource>
9491
</ItemGroup>
92+
<ItemGroup>
93+
<None Include="packages.config" />
94+
</ItemGroup>
9595
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
9696
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
9797
</Project>

src/FluentAssertions.Mvc3/FluentAssertions.Mvc3.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<copyright>Copyright 2013</copyright>
1515
<tags>TDD, TDD, Fluent, Mvc, AspNetMvc</tags>
1616
<dependencies>
17-
<dependency id="FluentAssertions" version="2.0.0.1" />
17+
<dependency id="FluentAssertions" version="[2.0.0.1,2.1)" />
1818
</dependencies>
1919
</metadata>
2020
</package>

src/FluentAssertions.Mvc3/RedirectResultAssertions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public RedirectResultAssertions WithUrl(string expectedUrl, string reason = "",
3333
{
3434
string actualUrl = (Subject as RedirectResult).Url;
3535

36-
Execute.Verification
36+
Execute.Assertion
3737
.ForCondition(string.Equals(actualUrl, expectedUrl, StringComparison.InvariantCultureIgnoreCase))
3838
.BecauseOf(reason, reasonArgs)
3939
.FailWith("Expected RedirectResult.Url to be {0}{reason} but was {1}", expectedUrl, actualUrl);
@@ -56,7 +56,7 @@ public RedirectResultAssertions WithPermanent(bool expectedPermanent, string rea
5656
{
5757
bool actualPermanent = (Subject as RedirectResult).Permanent;
5858

59-
Execute.Verification
59+
Execute.Assertion
6060
.ForCondition(expectedPermanent == actualPermanent)
6161
.BecauseOf(reason, reasonArgs)
6262
.FailWith("Expected RedirectResult.Permanent to be {0}{reason} but was {1}", expectedPermanent, actualPermanent);

src/FluentAssertions.Mvc3/RedirectToRouteAssertions.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public RedirectToRouteAssertions(RedirectToRouteResult subject)
3535
/// </param>
3636
public RedirectToRouteAssertions WithPermanent(bool expectedPermanent, string reason = "", params object[] reasonArgs)
3737
{
38-
Execute.Verification
38+
Execute.Assertion
3939
.BecauseOf(reason, reasonArgs)
4040
.ForCondition(expectedPermanent == Subject.Permanent)
4141
.FailWith("Expected RedirectToRoute.Permanent to be {0}{reason}, but found {1}", expectedPermanent, Subject.Permanent);
@@ -55,7 +55,7 @@ public RedirectToRouteAssertions WithPermanent(bool expectedPermanent, string re
5555
/// </param>
5656
public RedirectToRouteAssertions WithRouteName(string expectedRouteName, string reason = "", params object[] reasonArgs)
5757
{
58-
Execute.Verification
58+
Execute.Assertion
5959
.BecauseOf(reason, reasonArgs)
6060
.ForCondition(string.Equals(expectedRouteName, Subject.RouteName, StringComparison.InvariantCultureIgnoreCase))
6161
.FailWith("Expected RedirectToRoute.RouteName to be {0}{reason}, but found {1}", expectedRouteName, Subject.RouteName);
@@ -131,5 +131,13 @@ public RedirectToRouteAssertions WithArea(string expectedArea, string reason = "
131131
WithRouteValue("Area", expectedArea, reason, reasonArgs);
132132
return this;
133133
}
134+
135+
/// <summary>
136+
/// Returns the type of the subject the assertion applies on.
137+
/// </summary>
138+
protected override string Context
139+
{
140+
get { return "RedirectToRouteResult"; }
141+
}
134142
}
135143
}

src/FluentAssertions.Mvc3/RouteDataAssertions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ public RouteDataAssertions HaveDataToken(string key, object expectedValue, strin
7575
{
7676
var subjectTyped = Subject as RouteData;
7777

78-
Execute.Verification
78+
Execute.Assertion
7979
.ForCondition(subjectTyped.DataTokens.ContainsKey(key))
8080
.BecauseOf(reason, reasonArgs)
8181
.FailWith(FailureMessages.RouteData_DataTokens_ContainsKey, key);
8282

8383
var actualValue = subjectTyped.DataTokens[key];
8484

85-
Execute.Verification
85+
Execute.Assertion
8686
.ForCondition(expectedValue.Equals(actualValue))
8787
.BecauseOf(reason, reasonArgs)
8888
.FailWith(FailureMessages.RouteData_DataTokens_HaveValue, key, expectedValue, actualValue);
@@ -106,14 +106,14 @@ public RouteDataAssertions HaveValue(string key, object expectedValue, string re
106106
{
107107
var subjectTyped = Subject as RouteData;
108108

109-
Execute.Verification
109+
Execute.Assertion
110110
.ForCondition(subjectTyped.Values.ContainsKey(key))
111111
.BecauseOf(reason, reasonArgs)
112112
.FailWith(FailureMessages.RouteData_Values_ContainsKey, key);
113113

114114
var actualValue = subjectTyped.Values[key];
115115

116-
Execute.Verification
116+
Execute.Assertion
117117
.ForCondition(expectedValue.Equals(actualValue))
118118
.BecauseOf(reason, reasonArgs)
119119
.FailWith(FailureMessages.RouteData_Values_HaveValue, key, expectedValue, actualValue);

src/FluentAssertions.Mvc3/ViewResultAssertions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public ViewResultAssertions WithMasterName(string expectedMasterName, string rea
3131
{
3232
string actualMasterName = (Subject as ViewResult).MasterName;
3333

34-
Execute.Verification
34+
Execute.Assertion
3535
.ForCondition(string.Equals(expectedMasterName, actualMasterName, StringComparison.InvariantCultureIgnoreCase))
3636
.BecauseOf(reason, reasonArgs)
3737
.FailWith(FailureMessages.ViewResult_MasterName, expectedMasterName, actualMasterName);

0 commit comments

Comments
 (0)