@@ -61,7 +61,23 @@ public void OneTimeTearDown()
61
61
transaction . Commit ( ) ;
62
62
}
63
63
64
- public static IEnumerable < TestCase > GetNoExceptionOnExecuteQueryTestCases ( )
64
+ public class TestCaseItem
65
+ {
66
+ public string Name { get ; }
67
+ public string Hql { get ; }
68
+ public int LineNumber { get ; }
69
+
70
+ public TestCaseItem ( string name , string hql , [ CallerLineNumber ] int lineNumber = 0 )
71
+ {
72
+ Name = name ;
73
+ Hql = hql ;
74
+ LineNumber = lineNumber ;
75
+ }
76
+
77
+ public override string ToString ( ) => $ "{ LineNumber : 0000} : { Name } ";
78
+ }
79
+
80
+ public static IEnumerable < TestCaseItem > GetNoExceptionOnExecuteQueryTestCases ( )
65
81
{
66
82
/* does not work because of inner join or theta join created for many-to-one
67
83
@"
@@ -151,13 +167,13 @@ OR otherEntity.Name like 'A%'
151
167
}
152
168
153
169
[ Test , TestCaseSource ( nameof ( GetNoExceptionOnExecuteQueryTestCases ) ) ]
154
- public async Task NoExceptionOnExecuteQueryAsync ( TestCase testCase )
170
+ public async Task NoExceptionOnExecuteQueryAsync ( TestCaseItem testCase )
155
171
{
156
172
using var session = OpenSession ( ) ;
157
173
using var _ = session . BeginTransaction ( ) ;
158
174
159
175
var q = session . CreateQuery ( testCase . Hql ) ;
160
- Assert . AreEqual ( 1 , ( await ( q . ListAsync ( ) ) ) . Count ) ;
176
+ Assert . That ( await ( q . ListAsync ( ) ) , Has . Count . EqualTo ( 1 ) ) ;
161
177
}
162
178
163
179
protected override bool CheckDatabaseWasCleaned ( )
0 commit comments