Friday, December 11, 2020

[Code Snippet] Assert.Throws on Exception and Derived Type Nunit

 Code snippet for asserting throw in ArgumentException and its derived types(such as ArgumentNullException) in Nunit - 

public void Test(){

Assert.Throws(Is.InstanceOf<ArgumentException>(), () =>{

    //SUT code

});

}

Nunit , Unit Test

0 comments :

Post a Comment

 

© 2011 GIS and Remote Sensing Tools, Tips and more .. ToS | Privacy Policy | Sitemap

About Me