File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
src/JsonApiDotNetCore/Internal
test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ public class PageManager
1111 public int DefaultPageSize { get ; set ; }
1212 public int CurrentPage { get ; set ; }
1313 public bool IsPaginated => PageSize > 0 ;
14- public int TotalPages => ( TotalRecords == 0 || TotalRecords == null ) ? - 1 : ( int ) Math . Ceiling ( decimal . Divide ( TotalRecords . Value , PageSize ) ) ;
14+ public int TotalPages => ( TotalRecords == null ) ? - 1 : ( int ) Math . Ceiling ( decimal . Divide ( TotalRecords . Value , PageSize ) ) ;
1515
1616 public RootLinks GetPageLinks ( LinkBuilder linkBuilder )
1717 {
Original file line number Diff line number Diff line change @@ -88,7 +88,6 @@ public async Task Total_Record_Count_Not_Included_In_POST_Response()
8888 // arrange
8989 _context . TodoItems . RemoveRange ( _context . TodoItems ) ;
9090 _context . SaveChanges ( ) ;
91- var expectedCount = 1 ;
9291 var builder = new WebHostBuilder ( )
9392 . UseStartup < MetaStartup > ( ) ;
9493
@@ -120,7 +119,7 @@ public async Task Total_Record_Count_Not_Included_In_POST_Response()
120119
121120 // assert
122121 Assert . Equal ( HttpStatusCode . Created , response . StatusCode ) ;
123- Assert . Null ( documents . Meta ) ;
122+ Assert . False ( documents . Meta . ContainsKey ( "total-records" ) ) ;
124123 }
125124
126125 [ Fact ]
@@ -131,7 +130,6 @@ public async Task Total_Record_Count_Not_Included_In_PATCH_Response()
131130 TodoItem todoItem = new TodoItem ( ) ;
132131 _context . TodoItems . Add ( todoItem ) ;
133132 _context . SaveChanges ( ) ;
134- var expectedCount = 1 ;
135133 var builder = new WebHostBuilder ( )
136134 . UseStartup < MetaStartup > ( ) ;
137135
@@ -164,7 +162,7 @@ public async Task Total_Record_Count_Not_Included_In_PATCH_Response()
164162
165163 // assert
166164 Assert . Equal ( HttpStatusCode . OK , response . StatusCode ) ;
167- Assert . Null ( documents . Meta ) ;
165+ Assert . False ( documents . Meta . ContainsKey ( "total-records" ) ) ;
168166 }
169167
170168 [ Fact ]
You can’t perform that action at this time.
0 commit comments