@@ -60,20 +60,22 @@ describe("CollectionUtils", () => {
6060 } ) ;
6161
6262 test ( "given collections is undefined, it returns false" , ( ) : void => {
63- // Arrange & Act
64- const result = CollectionUtils . hasValues (
65- ( undefined as unknown ) as any [ ]
66- ) ;
63+ // Arrange
64+ const collection : any [ ] | undefined = undefined ;
65+
66+ // Act
67+ const result = CollectionUtils . hasValues ( collection ) ;
6768
6869 // Assert
6970 expect ( result ) . toBeFalse ( ) ;
7071 } ) ;
7172
7273 test ( "given collections is null, it returns false" , ( ) : void => {
73- // Arrange & Act
74- const result = CollectionUtils . hasValues (
75- ( null as unknown ) as any [ ]
76- ) ;
74+ // Arrange
75+ const collection : any [ ] | null = null ;
76+
77+ // Act
78+ const result = CollectionUtils . hasValues ( collection ) ;
7779
7880 // Assert
7981 expect ( result ) . toBeFalse ( ) ;
@@ -140,18 +142,22 @@ describe("CollectionUtils", () => {
140142 } ) ;
141143
142144 test ( "given collections is undefined, it returns true" , ( ) : void => {
143- // Arrange & Act
144- const result = CollectionUtils . isEmpty (
145- ( undefined as unknown ) as any [ ]
146- ) ;
145+ // Arrange
146+ const collection : any [ ] | undefined = undefined ;
147+
148+ // Act
149+ const result = CollectionUtils . isEmpty ( collection ) ;
147150
148151 // Assert
149152 expect ( result ) . toBeTrue ( ) ;
150153 } ) ;
151154
152155 test ( "given collections is null, it returns true" , ( ) : void => {
153- // Arrange & Act
154- const result = CollectionUtils . isEmpty ( ( null as unknown ) as any [ ] ) ;
156+ // Arrange
157+ const collection : any [ ] | null = null ;
158+
159+ // Act
160+ const result = CollectionUtils . isEmpty ( collection ) ;
155161
156162 // Assert
157163 expect ( result ) . toBeTrue ( ) ;
@@ -210,20 +216,22 @@ describe("CollectionUtils", () => {
210216 } ) ;
211217
212218 test ( "when collections param is undefined, it returns false" , ( ) : void => {
213- // Arrange & Act
214- const result = CollectionUtils . isNotEmpty (
215- ( undefined as unknown ) as any [ ]
216- ) ;
219+ // Arrange
220+ const collection : any [ ] | undefined = undefined ;
221+
222+ // Act
223+ const result = CollectionUtils . isNotEmpty ( collection ) ;
217224
218225 // Assert
219226 expect ( result ) . toBeFalse ( ) ;
220227 } ) ;
221228
222229 test ( "when collections param is null, it returns false" , ( ) : void => {
223- // Arrange & Act
224- const result = CollectionUtils . isNotEmpty (
225- ( null as unknown ) as any [ ]
226- ) ;
230+ // Arrange
231+ const collection : any [ ] | null = null ;
232+
233+ // Act
234+ const result = CollectionUtils . isNotEmpty ( collection ) ;
227235
228236 // Assert
229237 expect ( result ) . toBeFalse ( ) ;
0 commit comments