зеркало из
1
0
Форкнуть 0
nunit-csharp-samples/ExpectedExceptionExample/ExpectedExceptionTests.cs

22 строки
511 B
C#

using System;
using NUnit.Framework;
namespace ExpectedExceptionExample
{
[TestFixture]
public class ExpectedExceptionTests
{
[Test]
[ExpectedException(typeof(ArgumentException))]
public void HandlesArgumentExceptionAsType()
{
throw new ArgumentException();
}
[Test]
public void HandlesArgumentExceptionWithNewSyntax()
{
Assert.Throws<ArgumentException>(() => throw new ArgumentException());
}
}
}