Skip to content

Commit 1cd04a2

Browse files
Pushed updates addressing review comments.
1 parent 635ebd5 commit 1cd04a2

2 files changed

Lines changed: 6 additions & 11 deletions

File tree

test/JsonApiDotNetCoreTests/IntegrationTests/Meta/OperationsRequestMetaTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ public async Task Accepts_meta_in_update_resource_operation_with_ToMany_relation
144144
Dictionary<string, object?> identifierMeta1 = _fakers.IdentifierMeta.GenerateOne();
145145
Dictionary<string, object?> identifierMeta2 = _fakers.IdentifierMeta.GenerateOne();
146146

147+
string newFamilyName = _fakers.ProductFamily.GenerateOne().Name;
147148
ProductFamily existingFamily = _fakers.ProductFamily.GenerateOne();
148149
SupportTicket existingTicket1 = _fakers.SupportTicket.GenerateOne();
149150
SupportTicket existingTicket2 = _fakers.SupportTicket.GenerateOne();
@@ -168,7 +169,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
168169
id = existingFamily.StringId,
169170
attributes = new
170171
{
171-
name = existingFamily.Name
172+
name = newFamilyName
172173
},
173174
relationships = new
174175
{

test/JsonApiDotNetCoreTests/IntegrationTests/Meta/RequestMetaTests.cs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
9090
string route = $"/supportTickets/{existingTicket.StringId}";
9191

9292
// Act
93-
(HttpResponseMessage response, _) = await _testContext.ExecutePatchAsync<Document>(route, requestBody);
93+
(HttpResponseMessage httpResponse, _) = await _testContext.ExecutePatchAsync<Document>(route, requestBody);
9494

9595
// Assert
96-
response.ShouldHaveStatusCode(HttpStatusCode.NoContent);
96+
httpResponse.ShouldHaveStatusCode(HttpStatusCode.NoContent);
9797

9898
store.Document.Should().NotBeNull();
9999

@@ -176,10 +176,10 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
176176
string route = $"/productFamilies/{existingFamily.StringId}";
177177

178178
// Act
179-
(HttpResponseMessage response, _) = await _testContext.ExecutePatchAsync<Document>(route, requestBody);
179+
(HttpResponseMessage httpResponse, _) = await _testContext.ExecutePatchAsync<Document>(route, requestBody);
180180

181181
// Assert
182-
response.ShouldHaveStatusCode(HttpStatusCode.NoContent);
182+
httpResponse.ShouldHaveStatusCode(HttpStatusCode.NoContent);
183183

184184
store.Document.Should().NotBeNull();
185185

@@ -189,8 +189,6 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
189189

190190
store.Document.Data.SingleValue.Meta.Should().BeEquivalentToJson(resourceMeta);
191191

192-
store.Document.Data.SingleValue.Relationships.Should().NotBeNull();
193-
194192
store.Document.Data.SingleValue.Relationships.Should().ContainKey("tickets").WhoseValue.With(value =>
195193
{
196194
value.Should().NotBeNull();
@@ -265,8 +263,6 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
265263

266264
store.Document.Data.SingleValue.Meta.Should().BeEquivalentToJson(resourceMeta);
267265

268-
store.Document.Data.SingleValue.Relationships.Should().NotBeNull();
269-
270266
store.Document.Data.SingleValue.Relationships.Should().ContainKey("productFamily").WhoseValue.With(value =>
271267
{
272268
value.Should().NotBeNull();
@@ -352,8 +348,6 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
352348
store.Document.Data.SingleValue.Should().NotBeNull();
353349
store.Document.Data.SingleValue.Meta.Should().BeEquivalentToJson(resourceMeta);
354350

355-
store.Document.Data.SingleValue.Relationships.Should().NotBeNull();
356-
357351
store.Document.Data.SingleValue.Relationships.Should().ContainKey("tickets").WhoseValue.With(value =>
358352
{
359353
value.Should().NotBeNull();

0 commit comments

Comments
 (0)