expected-exception Questions
8
Solved
I thought these two tests should behave identically, in fact I have written the test in my project using MS Test only to find out now that it does not respect the expected message in the same way t...
Brummell asked 17/1, 2011 at 4:55
7
Solved
I'm using SpecFlow, and I'd like to write a scenario such as the following:
Scenario: Pressing add with an empty stack throws an exception
Given I have entered nothing into the calculator
When I...
Phyllis asked 21/5, 2010 at 8:46
5
This is weird, but all of a sudden the ExpectedExceptionAttribute quit working for me the other day. Not sure what's gone wrong. I'm running VS 2010 and VS 2005 side-by-side. It's not working in VS...
Gunther asked 23/7, 2009 at 0:59
3
I'm trying to verify that all my exceptions are correct. Because values are wrapped in CompletableFutures, the exception thrown is ExecutionException with cause being the exception that I would nor...
Striking asked 25/11, 2016 at 16:18
3
I have an application in the market for a year. Last week, I have changed the source code of my app. When I wanted to build the release version Android Studio throws an Error:
"Error: Expected a c...
Myron asked 20/4, 2016 at 20:3
5
Solved
I need to write a unit test for the next function and I saw I can use [ExpectedException]
this is the function to be tested.
public static T FailIfEnumIsNotDefined<T>(this T enumValue, stri...
Eductive asked 10/12, 2013 at 12:7
4
Solved
I have set up some JUnit (4.12) test with the ExpectedException feature, and I would like the test to continue after the expected exception. But I never see the log '3', as the execution seems to s...
Sawtelle asked 6/3, 2016 at 21:59
4
Solved
I've got several unittests of this pattern:
[TestMethod ()]
[ExpectedException (typeof (ArgumentNullException))]
public void DoStuffTest_Exception ()
{
var foo = new Foo ();
Foo.DoStuff (null);
...
Mice asked 22/10, 2009 at 10:51
3
Solved
I'm trying to work with ExpectedExceptions for JUnit. I tried already this:
public class ExpectedTest {
@Rule
public ExpectedException thrown = ExpectedException.none();
@Test
public void t...
Glenoid asked 10/4, 2014 at 13:21
1
Solved
I am trying to work with the ExpectedException attribute in a C# UnitTest, but I am having issues getting it to work with my particular Exception. Here's what I got:
NOTE: I wrapped asterisks arou...
Sightread asked 1/10, 2013 at 4:39
1
Solved
Got a question regarding the usage of junit's ExpectedException rule:
As suggested here: junit ExpectedException Rule
starting from junit 4.7 one can test exceptions like this (which is much bette...
Meningitis asked 18/7, 2013 at 11:19
3
Solved
Is there an equivalent to NUnit's ExpectedException or Assert.Throws<> in jUnit?
Roaring asked 27/6, 2009 at 11:35
1
Solved
I have a strange behavior in a tests where I want to test that an exception is thrown when null is passed in as a parameter. When I run the test I get from NUnit:
System.ArgumentNullException was...
Spirituous asked 26/11, 2011 at 12:46
3
Solved
I created a unit test for a method of my project. That method raises an exception when a file is not found. I wrote a unit test for that, but I'm still not able to pass the test when the exception ...
Crumple asked 4/2, 2011 at 10:23
1
Possible Duplicate:
How do you use PHPUnit to test a function if that function is supposed to kill PHP?
I'm writing some unit tests. The system I'm currently testing is a web-app in a...
Alcot asked 17/8, 2010 at 15:42
1
Solved
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 trac...
Waugh asked 30/12, 2009 at 20:59
1
© 2022 - 2024 — McMap. All rights reserved.