File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 99 <PackageId >Testimize</PackageId >
1010 <Configurations >Debug;Release</Configurations >
1111 <LangVersion >11.0</LangVersion >
12+ <IsPackable >true</IsPackable >
1213 </PropertyGroup >
1314
1415 <PropertyGroup >
Original file line number Diff line number Diff line change @@ -49,9 +49,12 @@ public override IEnumerable<object[]> GetData(MethodInfo testMethod)
4949 if ( sourceMethod == null )
5050 throw new InvalidOperationException ( $ "Static method '{ _configMethodName } ' not found in { declaringType . FullName } .") ;
5151
52- var testCases = ( List < TestCase > ) sourceMethod . Invoke ( null , null ) ;
53- if ( testCases == null )
54- throw new InvalidOperationException ( $ "Method '{ _configMethodName } ' returned null.") ;
52+ var result = sourceMethod . Invoke ( null , null ) ;
53+ if ( result is not List < TestCase > testCases )
54+ throw new InvalidOperationException ( $ "Method '{ _configMethodName } ' must return List<TestCase> but returned { result ? . GetType ( ) . Name ?? "null" } .") ;
55+
56+ if ( ! testCases . Any ( ) )
57+ throw new InvalidOperationException ( $ "Method '{ _configMethodName } ' returned no test cases.") ;
5558
5659 foreach ( var testCase in testCases )
5760 {
You can’t perform that action at this time.
0 commit comments