Skip to content

Instantly share code, notes, and snippets.

@csharpforevermore
Created September 13, 2018 14:17
Show Gist options
  • Save csharpforevermore/03ef32a529bb7d473363b80c5e1f596e to your computer and use it in GitHub Desktop.
Save csharpforevermore/03ef32a529bb7d473363b80c5e1f596e 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");
}
@csharpforevermore
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment