expectedexception

ExpectedException in jUnit?

Is there an equivalent to NUnit's ExpectedException or Assert.Throws<> in jUnit? ...

How does I use ExpectedException in C++/CLI NUnit tests?

How do you do the equivalent of: [Test, ExpectedException( typeof(ArgumentOutOfRangeException) )] void Test_Something_That_Throws_Exception() { throw gcnew ArgumentOutOfRangeException("Some more detail"); } ...in C++ (the example there is C#)? As far as I can see, there's no typeof() function for the C++ implementation of NUnit. ...

@ExpectedException in grails unit tests

Anyone used this annotation in grails unit tests? Didnt seem to work for me. Thanks. D Update: the last line of my test below does throw the expected exception. However the test fails (Stack trace too big for here...). I'm using grails 1.2 and running the test in eclipse's junit runner. Maybe grails is using an earlier version of junit...

NUnit - ExpectedMessage differs error

I am quite new to TDD and am going with NUnit and Moq. I have got a method where I expect an exception, so I wanted to play a little with the frameworks features. My test code looks as follows: [Test] [ExpectedException(ExpectedException = typeof(MockException), ExpectedMessage = "Actual differs from expected")] public void...

PHPUnit: continue after die, expect "die" or somehow handle die() ?

Hi all. I'm writing some unit tests. The system I'm currently testing is a web-app in an MVC framework. If we want to render pages without the site-skin system we've traditionally run our code as usual, but printed a "die();" statement at the end of the function to exit before the rest of the website renders. Well now that we're addi...