Skip to content

Commit 2639702

Browse files
committed
fix(#423): intermittent test failures caused by referencing incorrect type
1 parent 5d17929 commit 2639702

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/JsonApiDotNetCoreExampleTests/Acceptance/ManyToManyTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
using Microsoft.EntityFrameworkCore;
1212
using Newtonsoft.Json;
1313
using Xunit;
14-
using Person = JsonApiDotNetCoreExample.Models.Person;
1514

1615
namespace JsonApiDotNetCoreExampleTests.Acceptance
1716
{
@@ -21,6 +20,7 @@ public class ManyToManyTests
2120
private static readonly Faker<Article> _articleFaker = new Faker<Article>()
2221
.RuleFor(a => a.Name, f => f.Random.AlphaNumeric(10))
2322
.RuleFor(a => a.Author, f => new Author());
23+
2424
private static readonly Faker<Tag> _tagFaker = new Faker<Tag>().RuleFor(a => a.Name, f => f.Random.AlphaNumeric(10));
2525

2626
private TestFixture<TestStartup> _fixture;
@@ -66,9 +66,9 @@ public async Task Can_Create_Many_To_Many()
6666
// arrange
6767
var context = _fixture.GetService<AppDbContext>();
6868
var tag = _tagFaker.Generate();
69-
var author = new Person();
69+
var author = new Author();
7070
context.Tags.Add(tag);
71-
context.People.Add(author);
71+
context.Authors.Add(author);
7272
await context.SaveChangesAsync();
7373

7474
var article = _articleFaker.Generate();
@@ -85,7 +85,7 @@ public async Task Can_Create_Many_To_Many()
8585
{ "author", new {
8686
data = new
8787
{
88-
type = "people",
88+
type = "authors",
8989
id = author.StringId
9090
}
9191
} },
@@ -111,7 +111,7 @@ public async Task Can_Create_Many_To_Many()
111111
// assert
112112
var body = await response.Content.ReadAsStringAsync();
113113
Assert.True(HttpStatusCode.Created == response.StatusCode, $"{route} returned {response.StatusCode} status code with payload: {body}");
114-
114+
115115
var articleResponse = _fixture.GetService<IJsonApiDeSerializer>().Deserialize<Article>(body);
116116
Assert.NotNull(articleResponse);
117117

0 commit comments

Comments
 (0)