@@ -56,6 +56,20 @@ public void TestGetUrlParamsPreviousPage()
5656 Assert . Equal ( urlParamsPreviousPageExpected , pagination . UrlParamsPreviousPage ) ;
5757 }
5858
59+ [ Fact ]
60+ public void TestGetUrlParamsPreviousPageNoCount ( )
61+ {
62+ var pagination = CreatePaginationWithAllPropertiesSet ( ) ;
63+ pagination . Count = null ;
64+ var urlParamsPreviousPageExpected = new Dictionary < string , string >
65+ {
66+ { Pagination . PARAM_OLDER_ID , PAGINATION_OLDER_ID_CUSTOM . ToString ( ) }
67+ } ;
68+
69+ Assert . True ( pagination . HasPreviousPage ( ) ) ;
70+ Assert . Equal ( urlParamsPreviousPageExpected , pagination . UrlParamsPreviousPage ) ;
71+ }
72+
5973 [ Fact ]
6074 public void TestGetUrlParamsNextPageNewer ( )
6175 {
@@ -70,10 +84,25 @@ public void TestGetUrlParamsNextPageNewer()
7084 Assert . Equal ( urlParamsNextPageExpected , pagination . UrlParamsNextPage ) ;
7185 }
7286
87+ [ Fact ]
88+ public void TestGetUrlParamsNextPageNewerNoCount ( )
89+ {
90+ var pagination = CreatePaginationWithAllPropertiesSet ( ) ;
91+ pagination . Count = null ;
92+ var urlParamsNextPageExpected = new Dictionary < string , string >
93+ {
94+ { Pagination . PARAM_NEWER_ID , PAGINATION_NEWER_ID_CUSTOM . ToString ( ) }
95+ } ;
96+
97+ Assert . True ( pagination . HasNextPageAssured ( ) ) ;
98+ Assert . Equal ( urlParamsNextPageExpected , pagination . UrlParamsNextPage ) ;
99+ }
100+
73101 [ Fact ]
74102 public void TestGetUrlParamsNextPageFuture ( )
75103 {
76- var pagination = CreatePaginationWithNoNextPageAssured ( ) ;
104+ var pagination = CreatePaginationWithAllPropertiesSet ( ) ;
105+ pagination . NewerId = null ;
77106 var urlParamsNextPageExpected = new Dictionary < string , string >
78107 {
79108 { Pagination . PARAM_COUNT , PAGINATION_COUNT_CUSTOM . ToString ( ) } ,
@@ -84,45 +113,39 @@ public void TestGetUrlParamsNextPageFuture()
84113 Assert . Equal ( urlParamsNextPageExpected , pagination . UrlParamsNextPage ) ;
85114 }
86115
87- private static Pagination CreatePaginationWithNoNextPageAssured ( )
116+ [ Fact ]
117+ public void TestGetUrlParamsNextPageFutureNoCount ( )
88118 {
89119 var pagination = CreatePaginationWithAllPropertiesSet ( ) ;
90120 pagination . NewerId = null ;
121+ var urlParamsNextPageExpected = new Dictionary < string , string >
122+ {
123+ { Pagination . PARAM_COUNT , PAGINATION_COUNT_CUSTOM . ToString ( ) } ,
124+ { Pagination . PARAM_NEWER_ID , PAGINATION_FUTURE_ID_CUSTOM . ToString ( ) }
125+ } ;
91126
92- return pagination ;
127+ Assert . False ( pagination . HasNextPageAssured ( ) ) ;
128+ Assert . Equal ( urlParamsNextPageExpected , pagination . UrlParamsNextPage ) ;
93129 }
94130
95131 [ Fact ]
96132 public void TestGetUrlParamsPreviousPageFromPaginationWithNoPreviousPage ( )
97- {
98- var pagination = CreatePaginationWithNoPreviousPage ( ) ;
99-
100- Assert . False ( pagination . HasPreviousPage ( ) ) ;
101- Assert . Throws < BunqException > ( ( ) => pagination . UrlParamsPreviousPage ) ;
102- }
103-
104- private static Pagination CreatePaginationWithNoPreviousPage ( )
105133 {
106134 var pagination = CreatePaginationWithAllPropertiesSet ( ) ;
107135 pagination . OlderId = null ;
108136
109- return pagination ;
137+ Assert . False ( pagination . HasPreviousPage ( ) ) ;
138+ Assert . Throws < BunqException > ( ( ) => pagination . UrlParamsPreviousPage ) ;
110139 }
111140
112141 [ Fact ]
113- public void TestGetUrlParamsPreviousPageFromPaginationWithNoNextPage ( )
114- {
115- var pagination = CreatePaginationWithNoNextPage ( ) ;
116-
117- Assert . Throws < BunqException > ( ( ) => pagination . UrlParamsNextPage ) ;
118- }
119-
120- private static Pagination CreatePaginationWithNoNextPage ( )
142+ public void TestGetUrlParamsNextPageFromPaginationWithNoNextPage ( )
121143 {
122- var pagination = CreatePaginationWithNoNextPageAssured ( ) ;
144+ var pagination = CreatePaginationWithAllPropertiesSet ( ) ;
145+ pagination . NewerId = null ;
123146 pagination . FutureId = null ;
124147
125- return pagination ;
148+ Assert . Throws < BunqException > ( ( ) => pagination . UrlParamsNextPage ) ;
126149 }
127150 }
128151}
0 commit comments