Skip to content

Commit f854ec0

Browse files
PandaMagnusKeboo
andauthored
Save off variable from Assert.IsType
Co-authored-by: Kevin B <[email protected]>
1 parent c79412c commit f854ec0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

IntelliTect.TestTools.TestFramework.Tests/TestCaseTests/TestFailureTests.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,8 @@ public async Task AsyncBlockThrowsProperlyCatchAndLogException()
5151

5252
var ex = await Assert.ThrowsAsync<TestCaseException>(() => tc.ExecuteAsync());
5353
Assert.False(tc.Passed);
54-
Assert.NotNull(ex.InnerException);
55-
Assert.IsType<InvalidOperationException>(ex.InnerException);
56-
Assert.Contains("oops", ex.InnerException!.Message, StringComparison.InvariantCultureIgnoreCase);
54+
var invalidOp = Assert.IsType<InvalidOperationException>(ex.InnerException);
55+
Assert.Contains("oops", invalidOp.Message, StringComparison.InvariantCultureIgnoreCase);
5756
}
5857
}
5958
}

0 commit comments

Comments
 (0)