This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
tests/ServiceStack.Text.Tests Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -424,6 +424,18 @@ public void Does_convert_models_with_collections()
424424 Assert . That ( MatchesUsers ( from . Collection , from . Collection . ConvertTo < List < User > > ( ) ) ) ;
425425 Assert . That ( MatchesUsers ( from . Collection , from . Collection . ConvertTo < User [ ] > ( ) ) ) ;
426426 Assert . That ( MatchesUsers ( from . Collection , from . Collection . ConvertTo < HashSet < User > > ( ) ) ) ;
427+
428+ var array = from . Collection . ToArray ( ) ;
429+ Assert . That ( MatchesUsers ( array , from . Collection . ConvertTo < IEnumerable < User > > ( ) ) ) ;
430+ Assert . That ( MatchesUsers ( array , from . Collection . ConvertTo < List < User > > ( ) ) ) ;
431+ Assert . That ( MatchesUsers ( array , from . Collection . ConvertTo < User [ ] > ( ) ) ) ;
432+ Assert . That ( MatchesUsers ( array , from . Collection . ConvertTo < HashSet < User > > ( ) ) ) ;
433+
434+ var hashset = from . Collection . ToHashSet ( ) ;
435+ Assert . That ( MatchesUsers ( hashset , from . Collection . ConvertTo < IEnumerable < User > > ( ) ) ) ;
436+ Assert . That ( MatchesUsers ( hashset , from . Collection . ConvertTo < List < User > > ( ) ) ) ;
437+ Assert . That ( MatchesUsers ( hashset , from . Collection . ConvertTo < User [ ] > ( ) ) ) ;
438+ Assert . That ( MatchesUsers ( hashset , from . Collection . ConvertTo < HashSet < User > > ( ) ) ) ;
427439 }
428440 }
429441}
You can’t perform that action at this time.
0 commit comments