, , [*].
, , , , , NUnit :
Assert.Throws<ExceptionType>(() => { ... code block... });
Assert.DoesNotThrow(() => { ... code block... });
, [TestCleanup] [TestInitialize], .
[*] , , , try/catch:
public void ExecuteTest(Action test)
{
try
{
test.Invoke();
}
catch (Exception ex)
{
}
finally
{
}
}
[TestMethod]
public void This_is_a_Test_1()
{
Action test = () =>
{
};
this.ExecuteTest(test);
}