Skip to content

Commit 10e112d

Browse files
committed
Remove ShouldOnlyContainKeys
1 parent 3c1b7a8 commit 10e112d

File tree

11 files changed

+82
-74
lines changed

11 files changed

+82
-74
lines changed

test/DapperTests/IntegrationTests/QueryStrings/IncludeTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
204204
responseDocument.Data.ManyValue.ForEach(resource =>
205205
{
206206
resource.Type.Should().Be("todoItems");
207-
resource.Attributes.ShouldOnlyContainKeys("description", "priority", "durationInHours", "createdAt", "modifiedAt");
208-
resource.Relationships.ShouldOnlyContainKeys("owner", "assignee", "tags");
207+
resource.Attributes.Should().OnlyContainKeys("description", "priority", "durationInHours", "createdAt", "modifiedAt");
208+
resource.Relationships.Should().OnlyContainKeys("owner", "assignee", "tags");
209209
});
210210

211211
responseDocument.Included.Should().HaveCount(25 * 15 * 2);

test/DapperTests/IntegrationTests/ReadWrite/Resources/CreateResourceTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
100100
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("createdAt").With(value => value.Should().Be(DapperTestContext.FrozenTime));
101101
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("modifiedAt").With(value => value.Should().BeNull());
102102

103-
responseDocument.Data.SingleValue.Relationships.ShouldOnlyContainKeys("owner", "assignee", "tags");
103+
responseDocument.Data.SingleValue.Relationships.Should().OnlyContainKeys("owner", "assignee", "tags");
104104

105105
long newTodoItemId = long.Parse(responseDocument.Data.SingleValue.Id.ShouldNotBeNull());
106106
httpResponse.Headers.Location.Should().Be($"/todoItems/{newTodoItemId}");
@@ -235,7 +235,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
235235
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("durationInHours").With(value => value.Should().BeNull());
236236
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("createdAt").With(value => value.Should().Be(DapperTestContext.FrozenTime));
237237
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("modifiedAt").With(value => value.Should().BeNull());
238-
responseDocument.Data.SingleValue.Relationships.ShouldOnlyContainKeys("owner", "assignee", "tags");
238+
responseDocument.Data.SingleValue.Relationships.Should().OnlyContainKeys("owner", "assignee", "tags");
239239

240240
long newTodoItemId = long.Parse(responseDocument.Data.SingleValue.Id.ShouldNotBeNull());
241241

@@ -411,7 +411,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
411411
responseDocument.Data.SingleValue.Type.Should().Be("loginAccounts");
412412
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("userName").With(value => value.Should().Be(newUserName));
413413
responseDocument.Data.SingleValue.Attributes.Should().NotContainKey("lastUsedAt");
414-
responseDocument.Data.SingleValue.Relationships.ShouldOnlyContainKeys("recovery", "person");
414+
responseDocument.Data.SingleValue.Relationships.Should().OnlyContainKeys("recovery", "person");
415415

416416
long newLoginAccountId = long.Parse(responseDocument.Data.SingleValue.Id.ShouldNotBeNull());
417417

@@ -525,7 +525,7 @@ public async Task Can_create_resource_with_calculated_attribute()
525525
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("firstName").With(value => value.Should().Be(newPerson.FirstName));
526526
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("lastName").With(value => value.Should().Be(newPerson.LastName));
527527
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("displayName").With(value => value.Should().Be(newPerson.DisplayName));
528-
responseDocument.Data.SingleValue.Relationships.ShouldOnlyContainKeys("account", "ownedTodoItems", "assignedTodoItems");
528+
responseDocument.Data.SingleValue.Relationships.Should().OnlyContainKeys("account", "ownedTodoItems", "assignedTodoItems");
529529

530530
long newPersonId = long.Parse(responseDocument.Data.SingleValue.Id.ShouldNotBeNull());
531531

test/DapperTests/IntegrationTests/ReadWrite/Resources/FetchResourceTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
5858
responseDocument.Data.ManyValue[0].Attributes.ShouldContainKey("durationInHours").With(value => value.Should().Be(todoItems[1].DurationInHours));
5959
responseDocument.Data.ManyValue[0].Attributes.ShouldContainKey("createdAt").With(value => value.Should().Be(todoItems[1].CreatedAt));
6060
responseDocument.Data.ManyValue[0].Attributes.ShouldContainKey("modifiedAt").With(value => value.Should().Be(todoItems[1].LastModifiedAt));
61-
responseDocument.Data.ManyValue[0].Relationships.ShouldOnlyContainKeys("owner", "assignee", "tags");
61+
responseDocument.Data.ManyValue[0].Relationships.Should().OnlyContainKeys("owner", "assignee", "tags");
6262

6363
responseDocument.Data.ManyValue[1].Id.Should().Be(todoItems[0].StringId);
6464
responseDocument.Data.ManyValue[1].Attributes.ShouldContainKey("description").With(value => value.Should().Be(todoItems[0].Description));
6565
responseDocument.Data.ManyValue[1].Attributes.ShouldContainKey("priority").With(value => value.Should().Be(todoItems[0].Priority));
6666
responseDocument.Data.ManyValue[1].Attributes.ShouldContainKey("durationInHours").With(value => value.Should().Be(todoItems[0].DurationInHours));
6767
responseDocument.Data.ManyValue[1].Attributes.ShouldContainKey("createdAt").With(value => value.Should().Be(todoItems[0].CreatedAt));
6868
responseDocument.Data.ManyValue[1].Attributes.ShouldContainKey("modifiedAt").With(value => value.Should().Be(todoItems[0].LastModifiedAt));
69-
responseDocument.Data.ManyValue[1].Relationships.ShouldOnlyContainKeys("owner", "assignee", "tags");
69+
responseDocument.Data.ManyValue[1].Relationships.Should().OnlyContainKeys("owner", "assignee", "tags");
7070

7171
responseDocument.Meta.Should().ContainTotal(2);
7272

@@ -126,7 +126,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
126126
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("durationInHours").With(value => value.Should().Be(todoItem.DurationInHours));
127127
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("createdAt").With(value => value.Should().Be(todoItem.CreatedAt));
128128
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("modifiedAt").With(value => value.Should().Be(todoItem.LastModifiedAt));
129-
responseDocument.Data.SingleValue.Relationships.ShouldOnlyContainKeys("owner", "assignee", "tags");
129+
responseDocument.Data.SingleValue.Relationships.Should().OnlyContainKeys("owner", "assignee", "tags");
130130

131131
responseDocument.Meta.Should().BeNull();
132132

@@ -216,11 +216,11 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
216216

217217
responseDocument.Data.ManyValue[0].Id.Should().Be(todoItem.Tags.ElementAt(0).StringId);
218218
responseDocument.Data.ManyValue[0].Attributes.ShouldContainKey("name").With(value => value.Should().Be(todoItem.Tags.ElementAt(0).Name));
219-
responseDocument.Data.ManyValue[0].Relationships.ShouldOnlyContainKeys("todoItem", "color");
219+
responseDocument.Data.ManyValue[0].Relationships.Should().OnlyContainKeys("todoItem", "color");
220220

221221
responseDocument.Data.ManyValue[1].Id.Should().Be(todoItem.Tags.ElementAt(1).StringId);
222222
responseDocument.Data.ManyValue[1].Attributes.ShouldContainKey("name").With(value => value.Should().Be(todoItem.Tags.ElementAt(1).Name));
223-
responseDocument.Data.ManyValue[1].Relationships.ShouldOnlyContainKeys("todoItem", "color");
223+
responseDocument.Data.ManyValue[1].Relationships.Should().OnlyContainKeys("todoItem", "color");
224224

225225
responseDocument.Meta.Should().ContainTotal(2);
226226

@@ -284,7 +284,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
284284
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("firstName").With(value => value.Should().Be(todoItem.Owner.FirstName));
285285
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("lastName").With(value => value.Should().Be(todoItem.Owner.LastName));
286286
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("displayName").With(value => value.Should().Be(todoItem.Owner.DisplayName));
287-
responseDocument.Data.SingleValue.Relationships.ShouldOnlyContainKeys("account", "ownedTodoItems", "assignedTodoItems");
287+
responseDocument.Data.SingleValue.Relationships.Should().OnlyContainKeys("account", "ownedTodoItems", "assignedTodoItems");
288288

289289
responseDocument.Meta.Should().BeNull();
290290

test/DapperTests/IntegrationTests/ReadWrite/Resources/UpdateResourceTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
151151
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("durationInHours").With(value => value.Should().Be(newDurationInHours));
152152
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("createdAt").With(value => value.Should().Be(existingTodoItem.CreatedAt));
153153
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("modifiedAt").With(value => value.Should().Be(DapperTestContext.FrozenTime));
154-
responseDocument.Data.SingleValue.Relationships.ShouldOnlyContainKeys("owner", "assignee", "tags");
154+
responseDocument.Data.SingleValue.Relationships.Should().OnlyContainKeys("owner", "assignee", "tags");
155155

156156
await _testContext.RunOnDatabaseAsync(async dbContext =>
157157
{
@@ -308,7 +308,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
308308
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("durationInHours").With(value => value.Should().Be(newTodoItem.DurationInHours));
309309
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("createdAt").With(value => value.Should().Be(existingTodoItem.CreatedAt));
310310
responseDocument.Data.SingleValue.Attributes.ShouldContainKey("modifiedAt").With(value => value.Should().Be(DapperTestContext.FrozenTime));
311-
responseDocument.Data.SingleValue.Relationships.ShouldOnlyContainKeys("owner", "assignee", "tags");
311+
responseDocument.Data.SingleValue.Relationships.Should().OnlyContainKeys("owner", "assignee", "tags");
312312

313313
await _testContext.RunOnDatabaseAsync(async dbContext =>
314314
{

0 commit comments

Comments
 (0)