File tree Expand file tree Collapse file tree 1 file changed +6
-18
lines changed
src/NHibernate.Test/Criteria/Lambda Expand file tree Collapse file tree 1 file changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -12,28 +12,16 @@ public class CriteriaAssertFixture : LambdaFixtureBase
12
12
{
13
13
private void AssertCriteriaAreNotEqual ( ICriteria expected , ICriteria actual )
14
14
{
15
- try
16
- {
17
- AssertCriteriaAreEqual ( expected , actual ) ;
18
- Assert . Fail ( "No exception thrown" ) ;
19
- }
20
- catch
21
- {
22
- Assert . Pass ( ) ;
23
- }
15
+ Assert . Throws < AssertionException > (
16
+ ( ) => { AssertCriteriaAreEqual ( expected , actual ) ; } ,
17
+ "No exception thrown" ) ;
24
18
}
25
19
26
20
private void AssertCriteriaAreNotEqual ( DetachedCriteria expected , DetachedCriteria actual )
27
21
{
28
- try
29
- {
30
- AssertCriteriaAreEqual ( expected , actual ) ;
31
- Assert . Fail ( "No exception thrown" ) ;
32
- }
33
- catch
34
- {
35
- Assert . Pass ( ) ;
36
- }
22
+ Assert . Catch < AssertionException > (
23
+ ( ) => { AssertCriteriaAreEqual ( expected , actual ) ; } ,
24
+ "No exception thrown" ) ;
37
25
}
38
26
39
27
[ Test ]
You can’t perform that action at this time.
0 commit comments