In some cases its obvious when one or the other is warranted in other cases its not so clear. Take the following examples:
A method which takes two inputs, performs a calculation and returns the result.
A method which calls a factory object's Create method, passes the newly created object to the Add method of a collection object and re...
(This is a follow up question to this one.)
I'm having a problem with JUnit4 tests in eclipse. I'm trying to use the @Test(expected=...) annotation to unit test exception throwing. The problem is that when I run the tests, they come back as errors instead of passing, even though I'm expecting the exceptions to be thrown.
I'm using ecli...
I have a unit test invoking a constructor, passing in a "null" on purpose to test the handling of the null.
I expect the method invoked to throw an ArgumentNullException, but when I step through the code, I see the parameter has actually been initialised.
This has me stumped, although my gut says it has something to do with the DI cont...
Hi all:
Does anyone know the syntax for setUp and tearDown functions/methods for JsTestdriver? On their website they claim to be able to define it, but I can't get it right.
Thanks.
...
How should I create & run unit-tests for a Java/Tomcat Servlet-Applet application?
...
I am getting this error when i run my ms unit test cases in the solution.
If i run all the individual test cases its working and i am able to run the test cases.
is there any fix for this? Am i missing something?
...
Hi, I am trying to run all unit tests using eunit inside a folder but it seems like timeout always reset to 5 seconds.
e.g.
Module:
-module(example).
-include_lib("eunit/include/eunit.hrl").
main_test() ->
% sleep for 10 seconds
?assertEqual(true, begin timer:sleep(10000), true end).
Command line:
Eshell V5.7.3 (abort wit...
We have just released a re-written(for the 3rd time) module for our proprietary system. This module, which we call the Load Manager, is by far the most complicated of all the modules in our system to date. We are trying to get a comprehensive test suite because every time we make any kind of significant change to this module there is h...
Hi,
what are the best practices to unit test java servlets? By the way: this is a topic in which I have some dificulty: how do you unit test your java servlets?
...
I'm generating clover coverage reports (using Clover's maven plugin), and I'd like to exclude a certain package from the coverage reports (specifically, because it's UI code that intentionally isn't covered by my unit tests, but the reason doesn't really matter.)
I can see how to exclude that package from being instrumented (using in t...
I'm getting started with Python (it's high time I give it a shot), and I'm looking for some best practices.
My first project is a queue which runs command-line experiments in multiple threads. I'm starting to get a very long main.py file, and I'd like to break it up. In general, I'm looking for: How do python programmers organize multip...
I have been developing an iphone application using a domain model, and have put off the persistence aspect of the app until now. Core Data looks like a really good solution since I already have a well defined model but I am running into a snag with my existing unit tests.
Here is simple example of what I have now:
- (void)test_full_na...
I am new to Rhino Mocks, and using mock isolation frameworks in general for unit testing. I have written the following test, where I have set up an expectation for a mock IDataProvider object to return a collection of objects. The collection supplied has one object in it.
When I run the test, the call to the IDataProvider returns a empt...
How do I use XMLUnit to compare 2 or more nodes (of the same name) in 2 different files?
I have 2 XML files that look like this:
<SearchResults>
<result type="header"> ...ignore this.... </result>
<result type="secondheader">...ignore this....</result>
<result>....data1....</result>
<result>....data2....</result>
<result>.......
In Django, when I run "manage.py test", I get a lot of authentication related failures. Some examples:
FAIL: test_password_change_succeeds -- AssertionError 200 != 302
FAIL: Logout without next_page option renders the default template -- AssertionError 200 != 302
And:
Failed example:
form.non_field_errors()
Expected:
[u'This...
Hi all,
we're currently working on testing JTA failure behaviour, on a system that receives messages using JMS, persists them, and sends results using another class.
The whole thing is tied together using Spring. Current unit tests use HSQLDB, Apache ActiveMQ and Bitronix for transaction management. Success with this has been limited, ...
I am writing unit tests against my ASP.NET MVC application, in particular I am testing an HtmlHelper extension method that I wrote. There is a line inside of the extension method:
var innerHtml = htmlHelper.ActionLink(text, action, controller, routeValues, null);
When I run this inside of my unit test, the href of the generated URL i...
I want to test the data layer, how do I go about this? I am using NUnit for my business object testing. Must I use mock objects (which I have never used before)?
I would appreciate any amount of input if someone can just guide me in the right direction.
...
I have a Test::More test script for a module we have made. When running the test script by itself, it works just as expected.
Since there are several tests we need to run, I made a Test::Harness file that run all scripts. However, when executing from the Test::Harness runtests the script returns errors.
During debugging I tried to run ...
I using unit testing, to ensure that I can read connect string information from the ConnectStrings section of my app.config file. This works fine in the application proper, However when I attempt to generate a unit test for this under the Test Project, the dll.config file is being ignored, and the connectstring info from the machine.con...