我有一个MSTest,想要在不使用try
和catch
的情况下输出异常;如何在TestCleanup
?
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
double expected = 9.0;
double actual = 8.0;
Assert.AreEqual(expected, actual);
}
[TestCleanup]
public void Dispose()
{
Exception e;
Console.WriteLine(e.Message);
}
}