1111using  Microsoft . EntityFrameworkCore ; 
1212using  Newtonsoft . Json ; 
1313using  Xunit ; 
14- using  Person  =  JsonApiDotNetCoreExample . Models . Person ; 
1514
1615namespace  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