File tree 2 files changed +3
-5
lines changed
src/JsonApiDotNetCore/Internal
test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/DocumentTests 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ public class PageManager
11
11
public int DefaultPageSize { get ; set ; }
12
12
public int CurrentPage { get ; set ; }
13
13
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 ) ) ;
15
15
16
16
public RootLinks GetPageLinks ( LinkBuilder linkBuilder )
17
17
{
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()
88
88
// arrange
89
89
_context . TodoItems . RemoveRange ( _context . TodoItems ) ;
90
90
_context . SaveChanges ( ) ;
91
- var expectedCount = 1 ;
92
91
var builder = new WebHostBuilder ( )
93
92
. UseStartup < MetaStartup > ( ) ;
94
93
@@ -120,7 +119,7 @@ public async Task Total_Record_Count_Not_Included_In_POST_Response()
120
119
121
120
// assert
122
121
Assert . Equal ( HttpStatusCode . Created , response . StatusCode ) ;
123
- Assert . Null ( documents . Meta ) ;
122
+ Assert . False ( documents . Meta . ContainsKey ( "total-records" ) ) ;
124
123
}
125
124
126
125
[ Fact ]
@@ -131,7 +130,6 @@ public async Task Total_Record_Count_Not_Included_In_PATCH_Response()
131
130
TodoItem todoItem = new TodoItem ( ) ;
132
131
_context . TodoItems . Add ( todoItem ) ;
133
132
_context . SaveChanges ( ) ;
134
- var expectedCount = 1 ;
135
133
var builder = new WebHostBuilder ( )
136
134
. UseStartup < MetaStartup > ( ) ;
137
135
@@ -164,7 +162,7 @@ public async Task Total_Record_Count_Not_Included_In_PATCH_Response()
164
162
165
163
// assert
166
164
Assert . Equal ( HttpStatusCode . OK , response . StatusCode ) ;
167
- Assert . Null ( documents . Meta ) ;
165
+ Assert . False ( documents . Meta . ContainsKey ( "total-records" ) ) ;
168
166
}
169
167
170
168
[ Fact ]
You can’t perform that action at this time.
0 commit comments