Skip to content

Commit 162f695

Browse files
author
Chris Martinez
committed
Update Fluent Assertions
1 parent f5e2c65 commit 162f695

File tree

57 files changed

+161
-161
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+161
-161
lines changed

test/Microsoft.AspNet.OData.Versioning.ApiExplorer.Tests/Description/ODataApiExplorerTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public void api_description_group_should_explore_v3_actions( HttpConfiguration c
107107
var relativePaths = descriptions.Select( d => d.RelativePath ).ToArray();
108108

109109
// assert
110-
descriptions.ShouldBeEquivalentTo(
110+
descriptions.Should().BeEquivalentTo(
111111
new[]
112112
{
113113
new

test/Microsoft.AspNet.OData.Versioning.Tests/Web.OData/Routing/VersionedODataPathRouteConstraintTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public void match_should_return_400_when_requested_api_version_is_ambiguous()
132132
Action match = () => constraint.Match( request, null, null, values, UriResolution );
133133

134134
// assert
135-
match.ShouldThrow<HttpResponseException>().And.Response.StatusCode.Should().Be( BadRequest );
135+
match.Should().Throw<HttpResponseException>().And.Response.StatusCode.Should().Be( BadRequest );
136136
}
137137
}
138138
}

test/Microsoft.AspNet.WebApi.Acceptance.Tests/Http/Basic/given a version-neutral ApiController/when no version is specified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public async Task then_post_should_return_405()
3636
// assert
3737
response.StatusCode.Should().Be( MethodNotAllowed );
3838
response.Content.Headers.Allow.Should().BeEquivalentTo( "GET" );
39-
content.Error.ShouldBeEquivalentTo(
39+
content.Error.Should().BeEquivalentTo(
4040
new
4141
{
4242
Code = "UnsupportedApiVersion",

test/Microsoft.AspNet.WebApi.Acceptance.Tests/Http/Basic/given a versioned ApiController/when using a query string and split into two types.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public async Task then_get_should_return_200( string controller, string apiVersi
2727

2828
// assert
2929
response.Headers.GetValues( "api-supported-versions" ).Single().Should().Be( "1.0, 2.0" );
30-
content.ShouldBeEquivalentTo(
30+
content.Should().BeEquivalentTo(
3131
new Dictionary<string, string>()
3232
{
3333
["controller"] = controller,

test/Microsoft.AspNet.WebApi.Acceptance.Tests/Http/Basic/given a versioned ApiController/when using a url segment.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public async Task then_get_should_return_200( string requestUrl, string id )
3737

3838
// assert
3939
response.Headers.GetValues( "api-supported-versions" ).Single().Should().Be( "1.0" );
40-
content.ShouldBeEquivalentTo( body );
40+
content.Should().BeEquivalentTo( body );
4141
}
4242

4343
[Fact]

test/Microsoft.AspNet.WebApi.Acceptance.Tests/Http/ByNamespace/given a versioned ApiController per namespace/when using a query string.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public async Task then_get_should_return_200( string controller, string apiVersi
2828

2929
// assert
3030
response.Headers.GetValues( "api-supported-versions" ).Single().Should().Be( "1.0, 2.0, 3.0" );
31-
content.ShouldBeEquivalentTo( new { Controller = controller, ApiVersion = apiVersion, AccountId = "42" } );
31+
content.Should().BeEquivalentTo( new { Controller = controller, ApiVersion = apiVersion, AccountId = "42" } );
3232
}
3333

3434
[Fact]

test/Microsoft.AspNet.WebApi.Acceptance.Tests/Http/ByNamespace/given a versioned ApiController per namespace/when using a url segment and convention-based routing.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public async Task then_get_should_return_200( string controller, string apiVersi
2828

2929
// assert
3030
response.Headers.GetValues( "api-supported-versions" ).Single().Should().Be( "1.0, 2.0, 3.0" );
31-
content.ShouldBeEquivalentTo( new { Controller = controller, ApiVersion = apiVersion, AccountId = "42" } );
31+
content.Should().BeEquivalentTo( new { Controller = controller, ApiVersion = apiVersion, AccountId = "42" } );
3232
}
3333

3434
[Fact]

test/Microsoft.AspNet.WebApi.Acceptance.Tests/Http/Conventions/given a versioned ApiController using conventions/when using a query string and split into two types.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public async Task then_get_should_return_200( string controller, string apiVersi
2828

2929
// assert
3030
response.Headers.GetValues( "api-supported-versions" ).Single().Should().Be( "1.0, 2.0, 3.0" );
31-
content.ShouldBeEquivalentTo(
31+
content.Should().BeEquivalentTo(
3232
new Dictionary<string, string>()
3333
{
3434
["controller"] = controller,

test/Microsoft.AspNet.WebApi.Acceptance.Tests/Http/Conventions/given a versioned ApiController using conventions/when using a url segment.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public async Task then_get_should_return_200( string requestUrl, string controll
2929
// assert
3030
response.Headers.GetValues( "api-supported-versions" ).Single().Should().Be( "2.0, 3.0, 4.0" );
3131
response.Headers.GetValues( "api-deprecated-versions" ).Single().Should().Be( "1.0" );
32-
content.ShouldBeEquivalentTo( new { controller = controllerName, version = apiVersion } );
32+
content.Should().BeEquivalentTo( new { controller = controllerName, version = apiVersion } );
3333
}
3434

3535
[Theory]
@@ -48,7 +48,7 @@ public async Task then_get_with_id_should_return_200( string requestUrl, string
4848
// assert
4949
response.Headers.GetValues( "api-supported-versions" ).Single().Should().Be( "2.0, 3.0, 4.0" );
5050
response.Headers.GetValues( "api-deprecated-versions" ).Single().Should().Be( "1.0" );
51-
content.ShouldBeEquivalentTo( new { controller = controllerName, version = apiVersion, id = "42" } );
51+
content.Should().BeEquivalentTo( new { controller = controllerName, version = apiVersion, id = "42" } );
5252
}
5353

5454
[Fact]

test/Microsoft.AspNet.WebApi.Acceptance.Tests/Http/MediaTypeNegotiation/given a versioned ApiController/when using media type negotiation.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public async Task then_get_should_return_200( string controller, string apiVersi
3131

3232
// assert
3333
response.Headers.GetValues( "api-supported-versions" ).Single().Should().Be( "1.0, 2.0" );
34-
content.ShouldBeEquivalentTo( new { controller = controller, version = apiVersion } );
34+
content.Should().BeEquivalentTo( new { controller = controller, version = apiVersion } );
3535
}
3636

3737
[Fact]
@@ -62,7 +62,7 @@ public async Task then_get_should_allow_an_unspecified_version( string requestUr
6262
var content = await response.Content.ReadAsExampleAsync( example );
6363

6464
// assert
65-
content.ShouldBeEquivalentTo( new { controller = controller, version = apiVersion } );
65+
content.Should().BeEquivalentTo( new { controller = controller, version = apiVersion } );
6666
}
6767

6868
[Fact]

test/Microsoft.AspNet.WebApi.Acceptance.Tests/OData/Advanced/given a versioned ApiController mixed with OData controllers/when orders is v1.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public async Task then_get_should_return_200_for_an_unspecified_version()
2020
var orders = await response.EnsureSuccessStatusCode().Content.ReadAsExampleAsync( new[] { new { Id = 0, Customer = "" } } );
2121

2222
// assert
23-
orders.ShouldBeEquivalentTo( new[] { new { Id = 1, Customer = "Customer v1.0" } } );
23+
orders.Should().BeEquivalentTo( new[] { new { Id = 1, Customer = "Customer v1.0" } } );
2424
}
2525

2626
[Fact]
@@ -34,7 +34,7 @@ public async Task then_get_should_return_200()
3434
var orders = await response.EnsureSuccessStatusCode().Content.ReadAsExampleAsync( new[] { new { Id = 0, Customer = "" } } );
3535

3636
// assert
37-
orders.ShouldBeEquivalentTo( new[] { new { Id = 1, Customer = "Customer v1.0" } } );
37+
orders.Should().BeEquivalentTo( new[] { new { Id = 1, Customer = "Customer v1.0" } } );
3838
}
3939

4040
[Fact]
@@ -48,7 +48,7 @@ public async Task then_get_with_key_should_return_200_for_an_unspecified_version
4848
var order = await response.EnsureSuccessStatusCode().Content.ReadAsExampleAsync( new { Id = 0, Customer = "" } );
4949

5050
// assert
51-
order.ShouldBeEquivalentTo( new { Id = 42, Customer = "Customer v1.0" } );
51+
order.Should().BeEquivalentTo( new { Id = 42, Customer = "Customer v1.0" } );
5252
}
5353

5454
[Fact]
@@ -62,7 +62,7 @@ public async Task then_get_with_key_should_return_200()
6262
var order = await response.EnsureSuccessStatusCode().Content.ReadAsExampleAsync( new { Id = 0, Customer = "" } );
6363

6464
// assert
65-
order.ShouldBeEquivalentTo( new { Id = 42, Customer = "Customer v1.0" } );
65+
order.Should().BeEquivalentTo( new { Id = 42, Customer = "Customer v1.0" } );
6666
}
6767
}
6868
}

test/Microsoft.AspNet.WebApi.Acceptance.Tests/OData/Advanced/given a versioned ApiController mixed with OData controllers/when orders is v3.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public async Task then_get_should_return_200()
2020
var orders = await response.EnsureSuccessStatusCode().Content.ReadAsExampleAsync( new[] { new { Id = 0, Customer = "" } } );
2121

2222
// assert
23-
orders.ShouldBeEquivalentTo( new[] { new { Id = 1, Customer = "Customer v3.0" } } );
23+
orders.Should().BeEquivalentTo( new[] { new { Id = 1, Customer = "Customer v3.0" } } );
2424
}
2525

2626
[Fact]
@@ -34,7 +34,7 @@ public async Task then_get_with_key_should_return_200_for_an_unspecified_version
3434
var order = await response.EnsureSuccessStatusCode().Content.ReadAsExampleAsync( new { Id = 0, Customer = "" } );
3535

3636
// assert
37-
order.ShouldBeEquivalentTo( new { Id = 42, Customer = "Customer v3.0" } );
37+
order.Should().BeEquivalentTo( new { Id = 42, Customer = "Customer v3.0" } );
3838
}
3939
}
4040
}

test/Microsoft.AspNet.WebApi.Acceptance.Tests/OData/Advanced/given a versioned ODataController mixed Web API controllers/when orders is v2.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public async Task then_get_should_return_200()
2020
var orders = await response.EnsureSuccessStatusCode().Content.ReadAsExampleAsync( new { value = new[] { new { id = 0, customer = "" } } } );
2121

2222
// assert
23-
orders.value.ShouldBeEquivalentTo( new[] { new { id = 1, customer = "Customer v2.0" } }, options => options.ExcludingMissingMembers() );
23+
orders.value.Should().BeEquivalentTo( new[] { new { id = 1, customer = "Customer v2.0" } }, options => options.ExcludingMissingMembers() );
2424
}
2525

2626
[Fact]
@@ -34,7 +34,7 @@ public async Task then_get_with_key_should_return_200()
3434
var order = await response.EnsureSuccessStatusCode().Content.ReadAsExampleAsync( new { id = 0, customer = "" } );
3535

3636
// assert
37-
order.ShouldBeEquivalentTo( new { id = 42, customer = "Customer v2.0" }, options => options.ExcludingMissingMembers() );
37+
order.Should().BeEquivalentTo( new { id = 42, customer = "Customer v2.0" }, options => options.ExcludingMissingMembers() );
3838
}
3939
}
4040
}

test/Microsoft.AspNet.WebApi.Acceptance.Tests/OData/Advanced/given a versioned ODataController mixed Web API controllers/when people is v1.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public async Task then_get_should_return_200( string requestUrl )
2424
var people = await response.EnsureSuccessStatusCode().Content.ReadAsExampleAsync( example );
2525

2626
// assert
27-
people.value.ShouldBeEquivalentTo(
27+
people.value.Should().BeEquivalentTo(
2828
new[] { new { id = 1, firstName = "Bill", lastName = "Mei" } },
2929
options => options.ExcludingMissingMembers() );
3030
}
@@ -42,7 +42,7 @@ public async Task then_get_with_key_should_return_200( string requestUrl )
4242
var order = await response.EnsureSuccessStatusCode().Content.ReadAsExampleAsync( example );
4343

4444
// assert
45-
order.ShouldBeEquivalentTo(
45+
order.Should().BeEquivalentTo(
4646
new { id = 42, firstName = "Bill", lastName = "Mei" },
4747
options => options.ExcludingMissingMembers() );
4848
}

test/Microsoft.AspNet.WebApi.Acceptance.Tests/OData/Advanced/given a versioned ODataController mixed Web API controllers/when people is v2.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public async Task then_get_should_return_200()
2222
var people = await response.EnsureSuccessStatusCode().Content.ReadAsExampleAsync( example );
2323

2424
// assert
25-
people.value.ShouldBeEquivalentTo(
25+
people.value.Should().BeEquivalentTo(
2626
new[] { new { id = 1, firstName = "Bill", lastName = "Mei", email = "[email protected]" } },
2727
options => options.ExcludingMissingMembers() );
2828
}
@@ -38,7 +38,7 @@ public async Task then_get_with_key_should_return_200()
3838
var order = await response.EnsureSuccessStatusCode().Content.ReadAsExampleAsync( example );
3939

4040
// assert
41-
order.ShouldBeEquivalentTo(
41+
order.Should().BeEquivalentTo(
4242
new { id = 42, firstName = "Bill", lastName = "Mei", email = "[email protected]" },
4343
options => options.ExcludingMissingMembers() );
4444
}

test/Microsoft.AspNet.WebApi.Acceptance.Tests/OData/Advanced/given a versioned ODataController mixed Web API controllers/when people is v3.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public async Task then_get_should_return_200()
2222
var people = await response.EnsureSuccessStatusCode().Content.ReadAsExampleAsync( example );
2323

2424
// assert
25-
people.value.ShouldBeEquivalentTo(
25+
people.value.Should().BeEquivalentTo(
2626
new[] { new { id = 1, firstName = "Bill", lastName = "Mei", email = "[email protected]", phone = "555-555-5555" } },
2727
options => options.ExcludingMissingMembers() );
2828
}
@@ -38,7 +38,7 @@ public async Task then_get_with_key_should_return_200()
3838
var order = await response.EnsureSuccessStatusCode().Content.ReadAsExampleAsync( example );
3939

4040
// assert
41-
order.ShouldBeEquivalentTo(
41+
order.Should().BeEquivalentTo(
4242
new { id = 42, firstName = "Bill", lastName = "Mei", email = "[email protected]", phone = "555-555-5555" },
4343
options => options.ExcludingMissingMembers() );
4444
}

test/Microsoft.AspNet.WebApi.Versioning.ApiExplorer.Tests/Description/ApiDescriptionGroupCollectionTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public void flatten_should_return_denormalized_api_descriptions_in_order()
6262
var descriptions = collection.Flatten().Cast<VersionedApiDescription>();
6363

6464
// assert
65-
descriptions.ShouldBeEquivalentTo(
65+
descriptions.Should().BeEquivalentTo(
6666
new Collection<VersionedApiDescription>()
6767
{
6868
new VersionedApiDescription() { ApiVersion = new ApiVersion( 1, 0 ), RelativePath = "api/people" },

test/Microsoft.AspNet.WebApi.Versioning.ApiExplorer.Tests/Description/ApiVersionParameterDescriptionContextTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public void add_parameter_should_add_descriptor_for_query_parameter()
3131
context.AddParameter( "api-version", Query );
3232

3333
// assert
34-
description.ParameterDescriptions.Single().ShouldBeEquivalentTo(
34+
description.ParameterDescriptions.Single().Should().BeEquivalentTo(
3535
new
3636
{
3737
Name = "api-version",
@@ -66,7 +66,7 @@ public void add_parameter_should_add_descriptor_for_header()
6666
context.AddParameter( "api-version", Header );
6767

6868
// assert
69-
description.ParameterDescriptions.Single().ShouldBeEquivalentTo(
69+
description.ParameterDescriptions.Single().Should().BeEquivalentTo(
7070
new
7171
{
7272
Name = "api-version",
@@ -102,7 +102,7 @@ public void add_parameter_should_add_descriptor_for_path()
102102
context.AddParameter( "api-version", Path );
103103

104104
// assert
105-
description.ParameterDescriptions.Single().ShouldBeEquivalentTo(
105+
description.ParameterDescriptions.Single().Should().BeEquivalentTo(
106106
new
107107
{
108108
Name = "api-version",
@@ -228,7 +228,7 @@ public void add_parameter_should_add_optional_parameter_when_allowed()
228228
context.AddParameter( "api-version", Query );
229229

230230
// assert
231-
description.ParameterDescriptions.Single().ShouldBeEquivalentTo(
231+
description.ParameterDescriptions.Single().Should().BeEquivalentTo(
232232
new
233233
{
234234
Name = "api-version",

test/Microsoft.AspNet.WebApi.Versioning.ApiExplorer.Tests/Description/VersionedApiExplorerTest.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public void api_descriptions_should_recognize_direct_routes()
3737
var descriptions = apiExplorer.ApiDescriptions;
3838

3939
// assert
40-
descriptions.Single().Should().ShouldBeEquivalentTo(
40+
descriptions.Single().Should().Should().BeEquivalentTo(
4141
new { HttpMethod = Get, RelativePath = routeTemplate, ActionDescriptor = action },
4242
options => options.ExcludingMissingMembers() );
4343
}
@@ -63,7 +63,7 @@ public void api_descriptions_should_ignore_api_for_direct_route_action()
6363
var descriptions = apiExplorer.ApiDescriptions;
6464

6565
// assert
66-
descriptions.Single().Should().ShouldBeEquivalentTo(
66+
descriptions.Single().Should().Should().BeEquivalentTo(
6767
new { HttpMethod = Get, RelativePath = routeTemplate },
6868
options => options.ExcludingMissingMembers() );
6969
}
@@ -113,7 +113,7 @@ public void api_descriptions_should_recognize_composite_routes()
113113
var descriptions = apiExplorer.ApiDescriptions;
114114

115115
// assert
116-
descriptions.Single().Should().ShouldBeEquivalentTo(
116+
descriptions.Single().Should().Should().BeEquivalentTo(
117117
new { HttpMethod = Get, RelativePath = routeTemplate, ActionDescriptor = action },
118118
options => options.ExcludingMissingMembers() );
119119
}
@@ -210,7 +210,7 @@ public void api_descriptions_should_recognize_mixedX2Dcase_parameters()
210210
var descriptions = apiExplorer.ApiDescriptions;
211211

212212
// assert
213-
descriptions.Single().Should().ShouldBeEquivalentTo(
213+
descriptions.Single().Should().Should().BeEquivalentTo(
214214
new { HttpMethod = Get, RelativePath = routeTemplate, ActionDescriptor = action },
215215
options => options.ExcludingMissingMembers() );
216216
}
@@ -288,7 +288,7 @@ public void api_description_group_should_explore_v1_actions( HttpConfiguration c
288288
var relativePath = description.RelativePath;
289289

290290
// assert
291-
description.ShouldBeEquivalentTo(
291+
description.Should().BeEquivalentTo(
292292
new
293293
{
294294
ID = $"GET{relativePath}",
@@ -313,7 +313,7 @@ public void api_description_group_should_explore_v2_actions( HttpConfiguration c
313313
var relativePaths = descriptions.Select( d => d.RelativePath ).ToArray();
314314

315315
// assert
316-
descriptions.ShouldBeEquivalentTo(
316+
descriptions.Should().BeEquivalentTo(
317317
new[]
318318
{
319319
new
@@ -348,7 +348,7 @@ public void api_description_group_should_explore_v3_actions( HttpConfiguration c
348348
var relativePaths = descriptions.Select( d => d.RelativePath ).ToArray();
349349

350350
// assert
351-
descriptions.ShouldBeEquivalentTo(
351+
descriptions.Should().BeEquivalentTo(
352352
new[]
353353
{
354354
new
@@ -394,7 +394,7 @@ public void api_description_group_should_explore_v3_beta_actions( HttpConfigurat
394394

395395
// assert
396396
descriptionGroup.IsDeprecated.Should().BeTrue();
397-
descriptions.ShouldBeEquivalentTo(
397+
descriptions.Should().BeEquivalentTo(
398398
new[]
399399
{
400400
new
@@ -429,7 +429,7 @@ public void api_description_group_should_explore_v4_actions( HttpConfiguration c
429429
var relativePaths = descriptions.Select( d => d.RelativePath ).ToArray();
430430

431431
// assert
432-
descriptions.ShouldBeEquivalentTo(
432+
descriptions.Should().BeEquivalentTo(
433433
new[]
434434
{
435435
new

0 commit comments

Comments
 (0)