Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

test how catch exception c#

[TestMethod]
[ExpectedException(typeof(ArgumentException),
    "A userId of null was inappropriately allowed.")]
public void NullUserIdInConstructor()
{
   LogonInfo logonInfo = new LogonInfo(null, "P@ss0word");
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #test #catch #exception
ADD COMMENT
Topic
Name
9+1 =