File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed
Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -477,7 +477,7 @@ A paginator must implement the following methods:
477477
478478In addition, the constructor must meet the following requirements:
479479
480- - A paginator must have a constructor with one parameter
480+ - A paginator must have a constructor with one or more parameters
481481- The first parameter of the constructor is a pageable or scrollable component to be controlled
482482- The type of the first parameter must be a subclass of ` MonoBehaviour `
483483
Original file line number Diff line number Diff line change @@ -14,9 +14,9 @@ namespace TestHelper.UI.Paginators
1414 /// <remarks>
1515 /// The implementation class must meet the following requirements:
1616 /// <list type="bullet">
17- /// <item>A paginator must have a constructor with one parameter. </item>
18- /// <item>The first parameter of the constructor is a pageable or scrollable component to be controlled. </item>
19- /// <item>The type of the first parameter must be a subclass of <c>MonoBehaviour</c>. </item>
17+ /// <item>A paginator must have a constructor with one or more parameters </item>
18+ /// <item>The first parameter of the constructor is a pageable or scrollable component to be controlled</item>
19+ /// <item>The type of the first parameter must be a subclass of <c>MonoBehaviour</c></item>
2020 /// </list>
2121 /// <seealso cref="TestHelper.UI.Paginators.IPaginatorTest"/>
2222 /// </remarks>
Original file line number Diff line number Diff line change @@ -21,15 +21,16 @@ private static Type[] GetPaginators()
2121 /// Verify that the paginators and supported component type can be obtained via reflection.
2222 /// </summary>
2323 [ TestCaseSource ( nameof ( GetPaginators ) ) ]
24- public void Constructor_HasOneParameter_ ( Type paginatorType )
24+ public void Constructor_HasOneParameterAndSubclassOfMonoBehaviour ( Type paginatorType )
2525 {
2626 var ctor = paginatorType . GetConstructors ( )
27- . FirstOrDefault ( x => x . GetParameters ( ) . Length == 1 ) ;
28- Assume . That ( ctor , Is . Not . Null , "The paginator must have a constructor with one parameter." ) ;
27+ . OrderBy ( x => x . GetParameters ( ) . Length )
28+ . FirstOrDefault ( x => x . GetParameters ( ) . Length > 0 ) ;
29+ Assume . That ( ctor , Is . Not . Null , "A paginator must have a constructor with one or more parameters." ) ;
2930
3031 var parameterType = ctor . GetParameters ( ) [ 0 ] . ParameterType ;
3132 Assert . That ( parameterType . IsSubclassOf ( typeof ( MonoBehaviour ) ) , Is . True ,
32- "The first constructor parameter of the paginator must be a MonoBehaviour subclass type ." ) ;
33+ "The first parameter of the constructor is a pageable or scrollable component to be controlled, which must be a subclass of MonoBehaviour ." ) ;
3334 }
3435 }
3536}
You can’t perform that action at this time.
0 commit comments