Record.Exception
|xUnit.net has done away with the ExpectedException attribute in favor of Assert.Throws. See [[Note 1]]
|-
|[SetUp]
public string Name { get; }
}
</syntaxhighlight>테스트 코드<syntaxhighlight lang="csharp">[TestMethod, ExpectedException(typeof(ArgumentNullException))]public void NullNameShouldThrowTest(){ var person = new Person(null!);}</syntaxhighlight> ===== Note 3 =====<br />
{{DEFAULTSORT:xUnit.net}}