Skip to content

Commit 0a6b8ef

Browse files
committed
Simplify test assertions
1 parent 940c28c commit 0a6b8ef

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/JsonApiDotNetCoreMongoDbTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
8585
responseDocument.Data.ManyValue[0].Attributes.ShouldContainKey("caption").With(value => value.Should().Be(post.Caption));
8686
responseDocument.Data.ManyValue[0].Relationships.Should().BeNull();
8787

88-
var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).And.Subject.Single();
88+
var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).Which;
8989
postCaptured.Caption.Should().Be(post.Caption);
9090
postCaptured.Url.Should().BeNull();
9191
}
@@ -140,7 +140,7 @@ await _testContext.RunOnDatabaseAsync(dbContext =>
140140
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("url").With(value => value.Should().Be(post.Url));
141141
responseDocument.Data.SingleValue.Relationships.Should().BeNull();
142142

143-
var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).And.Subject.Single();
143+
var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).Which;
144144
postCaptured.Url.Should().Be(post.Url);
145145
postCaptured.Caption.Should().BeNull();
146146
}
@@ -262,7 +262,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
262262
responseDocument.Data.ManyValue[0].Attributes.ShouldContainKey("caption").With(value => value.Should().Be(post.Caption));
263263
responseDocument.Data.ManyValue[0].Relationships.Should().BeNull();
264264

265-
var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).And.Subject.Single();
265+
var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).Which;
266266
postCaptured.Id.Should().Be(post.Id);
267267
postCaptured.Caption.Should().Be(post.Caption);
268268
postCaptured.Url.Should().BeNull();
@@ -297,7 +297,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
297297
responseDocument.Data.ManyValue[0].Attributes.Should().BeNull();
298298
responseDocument.Data.ManyValue[0].Relationships.Should().BeNull();
299299

300-
var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).And.Subject.Single();
300+
var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).Which;
301301
postCaptured.Id.Should().Be(post.Id);
302302
postCaptured.Url.Should().BeNull();
303303
}
@@ -332,7 +332,7 @@ await _testContext.RunOnDatabaseAsync(dbContext =>
332332
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("showAdvertisements").With(value => value.Should().Be(blog.ShowAdvertisements));
333333
responseDocument.Data.SingleValue.Relationships.Should().BeNull();
334334

335-
var blogCaptured = (Blog)store.Resources.Should().ContainSingle(resource => resource is Blog).And.Subject.Single();
335+
var blogCaptured = (Blog)store.Resources.Should().ContainSingle(resource => resource is Blog).Which;
336336
blogCaptured.ShowAdvertisements.Should().Be(blog.ShowAdvertisements);
337337
blogCaptured.IsPublished.Should().Be(blog.IsPublished);
338338
blogCaptured.Title.Should().Be(blog.Title);

0 commit comments

Comments
 (0)