|Related to : Ruby: Tests not runing|
|Unit tests - refactor to share data between tests in C#|
I am currently working on something similar and have introduced a Data
class in my project. This simply contains a bunch of static data. It's
a partial class so I can structure it a bit. I have a DataOrder.cs,
DataOrderLine.cs and so on. Then there's public property for example
Orders, which I can use in my test to get my test data.
Don't put all the data in base classes, this will be harder to m
|How can I tell if any BOOST_CHECK tests have failed so far?|
BOOST_CHECK asserts on a condition that is required for the test to
pass, but is not required for the test to continue executing.
BOOST_REQUIRE on the other hand asserts on a condition that is
required for the test to continue. Use this macro for asserts that
should abort the test on failure. In your case it looks like you want
to use this for every assert prior to foo.do_something().
|Functional tests using PHPUnit|
I have achieved success in writing PHP functional tests using Guzzle.
It allows you to perform HTTP requests like this:
$client = new GuzzleHttpClient();
$response = $client->get('http://guzzlephp.org');
And the $client will maintain the PHPSESSIONID across requests,
allowing you to perform authenticated requests by logging in and then
performing requests with the same client.
|How to run also ignored tests in JUnit 4 from command line?|
It turned out this is quite easy achievable with:
JUnitCore junit = new JUnitCore();
I will leave this answer open if anybody comes up with something
better, which just prevents IgnoredClassRunner to be invoked for
classes annotated with @Ignored
|Python nosetests runs tests twice|
I had a similar issue. After turning up verbosity (as suggested by
Schollii above) and comparing notes on this question what worked for
me was deleting the init.py (and init.pyc of course) in my main code
folder (of which tests were a subdirectory).