Skip to content

Commit 00c4ee8

Browse files
committed
test(deleting): server must respond 204 on delete
this check was happening on the wrong test
1 parent f2ca23b commit 00c4ee8

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DeletingDataTests.cs

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
1-
using System.Collections.Generic;
21
using System.Linq;
32
using System.Net;
43
using System.Net.Http;
5-
using System.Net.Http.Headers;
64
using System.Threading.Tasks;
75
using Bogus;
86
using DotNetCoreDocs;
97
using DotNetCoreDocs.Writers;
10-
using JsonApiDotNetCore.Serialization;
11-
using JsonApiDotNetCore.Services;
128
using JsonApiDotNetCoreExample;
139
using JsonApiDotNetCoreExample.Data;
1410
using JsonApiDotNetCoreExample.Models;
1511
using Microsoft.AspNetCore.Hosting;
1612
using Microsoft.AspNetCore.TestHost;
17-
using Newtonsoft.Json;
1813
using Xunit;
1914

2015
namespace JsonApiDotNetCoreExampleTests.Acceptance.Spec
@@ -55,7 +50,7 @@ public async Task Respond_404_If_EntityDoesNotExist()
5550
var response = await client.SendAsync(request);
5651

5752
// Assert
58-
Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
53+
Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
5954
}
6055
}
6156
}

test/JsonApiDotNetCoreExampleTests/Acceptance/TodoItemsControllerTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ public async Task Can_Delete_TodoItem()
424424
var response = await _fixture.MakeRequest<TodoItem>(description, request);
425425

426426
// Assert
427-
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
427+
Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
428428
Assert.Null(_context.TodoItems.FirstOrDefault(t => t.Id == todoItem.Id));
429429
}
430430
}

0 commit comments

Comments
 (0)