Skip to content

Instantly share code, notes, and snippets.

@csharpforevermore
Created September 13, 2018 14:17
Show Gist options
  • Save csharpforevermore/fe429d7a3ec45af681ed31c482d3c964 to your computer and use it in GitHub Desktop.
Save csharpforevermore/fe429d7a3ec45af681ed31c482d3c964 to your computer and use it in GitHub Desktop.
Use Assert to verify that an exception has been thrown?
[TestMethod]
[ExpectedException(typeof(ArgumentException),
"A userId of null was inappropriately allowed.")]
public void NullUserIdInConstructor()
{
LogonInfo logonInfo = new LogonInfo(null, "P@ss0word");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment