tag:blogger.com,1999:blog-10896391.post752276216364511362..comments2023-11-21T09:04:58.942+00:00Comments on Johnno's Nose: The case of the missing assertAnonymoushttp://www.blogger.com/profile/15620075254402056526noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-10896391.post-79035875719635443272010-03-06T07:45:53.924+00:002010-03-06T07:45:53.924+00:00Before I discovered the NUnit Assert.Throws syntax...Before I discovered the NUnit Assert.Throws syntax I used to use ExpectedException and have an Assert.IsTrue(false) at the end of the test. But I always put a message in there to explain why it was fail. <br /><br />It never felt right to just not have an assert but at the same time that didn't look quite right either.<br /><br />One problem I have with testing constructors throw via Assert.Throws is that you have to have curly brackets in your lambda EG<br /><br />Assert.Throws(() => { var myClass = new myClass(null)} );<br /><br />It just doesn't sit right with meAnonymoushttps://www.blogger.com/profile/10699704896631441178noreply@blogger.com