From reasons I won't get into, all our unit tests are using the VSTS test framework. I now want to create an MSBuild script that runs the tests, but I don't want to use mstest.exe from various reasons (it's slower, requires Visual Studio installation everywhere, I need to maintain testrunconfig, etc.)
I've seen that TestDriven.net and T...
Hi I have a question related to MockEJB. I need to write unit tests to test a code that is calling a EJB. I use Mockito to write a mock for the EJB, and MockEJB to simulate the JNDI context.
My tests look like this :
@Test
public void test1() throws Exception {
// create a mock instance
NetworkManager aMockManager = createMockNet...
Currently I am using DDsteps as a datadriven testing framework for my unit tests. It works quite well, except when inserting DateTime data into the database.
Example data input row (stored in excel):
APS_ID99${my.unique_four_digits}
APS_LOGIN_DT3/21/2007 8:52
DDsteps will generate this SQL to load the date time field:
insert...
All:
I have a unit test that is testing functionality that requires an input file. This test was built using VS 2008's built-in unit testing feature.
My problem is that the file needs to be discoverable by the unit test. However, when the test runs, it runs from a temporary "output" directory under the test results folder. It can't fi...
I've used unit tests successfully for a while, but I'm beginning to think they're only useful for classes/methods that actually perform a fair amount of logic - parsers, doing math, complex business logic - all good candidates for testing, no question. I'm really struggling to figure out how to use testing for another class of objects: t...
I want that my application catches the exceptions and e-mail them when running in production, but when I am running my MSTest unit tests I want it to throw the exceptions, so I can debug. My current code always e-mails the exceptions. There is any way to know if the current process was invoked by the unit tests?
One way I can think is t...
I have code in the top layer of my .Net web application that I'd like to unit test, but when my build server compiles the project using the aspnet_compiler.exe, it makes a .dll file that is not at all usable by another project, i.e. an NUnit test project.
(This is true of ASP .Net web applications and of ASP .Net MVC applications.)
Am ...
I'm looking for the easiest way to categorize my tests so I can run them separately.
My organization would be something like the following
Units Tests
Integrations Tests
Systems Test
The reasoning for this is all our testing hasn't evolved to be completely automated yet. Most of our unit tests are completely automated, while integ...
Apple's "iPhone Development Guide" suggests on page 62 that "Because application tests run only on a device, you can also use these tests to perform hardware testing...".
I'd like to run my OCUnit test cases in the simulator as well -- but haven't figured out how to do that. Is it possible? Or do I have to use Google's toolkit instead? ...
Hi,
I have created several files with unit tests on existing classes in NetBeans project.
I used menu "File/New file/JUnit/Test for Existing Class" to create test files.
I can run one file with unit tests by right click on it and select "Run File".
But I want to run all files with unit tests.
How can I achieve this in the simplest way...
For fun, I'm going to write my own implementations of common data structures like Linked List or Binary Sorted Tree. Are there any good test suites that already exist that I can use to make sure they are fully living up to their contracts?
(It probably wouldn't be that hard to test them myself, but if it's already been done I don't want...
So I have two classes:
IOPin & Node
A Node has a set of IOPins.
To support loose coupling, and separation of concerns, I don't want the IOPins to have to know anything about Node. The Node should deal with adding/removing IOPins and should also deal with any error checking logic associated with this.
This causes an issue when I want ...
Dear Sirs,
The preface: I'm struggeling with LazyInitializationException in my Unit Tests, and I have a really hard time getting my head around it, as you can see from my questions
Database Sessions in Spring, TestNG and Spring 3 and LazyInitializationException while unit-testing Hibernate entity classes for use in Spring, using TestNG...
Hi all!
I have a code contract on some interface IImageRepository:
[ContractClassFor(typeof(IImageRepository))]
sealed class IImageRepositoryContract : IImageRepository
{
IImage IImageRepository.GetById(int imageId)
{
Contract.Requires(imageId > 0);
return default(IImage);
}
}
I want to test code contract...
i have an abstract class and im trying to mock out events being attached to it using Rhino Mocks. Here a bit of the abstract class
public abstract class Download
{
public virtual event EventHandler<DownloadProgressEventArgs> DownloadProgress_Changed;
protected virtual void OnDownloadProgressChanged(DownloadProgressEventargs e)
...
I am doing a unit test on a class that uses the unity dependency injection framework.
This returns null:
ServiceLocator.Current.GetInstance();
How can I get it to return a mock object or just the object itself?
...
I'm writing unit tests for a portion of an application that runs as an HTTP server. The approach I have been trying to take is to import the module that contains the HTTP server, start it. Then, the unit tests will use urllib2 to connect, send data, and check the response.
Our HTTP server is using Twisted. One problem here is that I'...
I've recently stumbled upon T#. It seems a nice concept but I'm wondering if it's worth switching from nUnit to this? I love the pros but hate the cons so I'm still undecided
Pros:
specialized language for unit testing (keywords)
relative assertions
compile time warnings
focus on test intentions
Cons:
lack of (integrated) tool sup...
Hi SO's,
Many thanks for the advice you have given me thus far. Using testbenches is something this forum has really shown me the light on and for that I am appreciative. My problem is that I am playing with a singleton and normally I won't del it, but in a testbench I will need to. So can anyone show me how to del the thing? I've s...
I'm trying to retrofit some tests using Test::More to legacy code and I've bumped into a bit of a snag. I don't seem to be able to set %ENV in the test module. The called function definitely uses this variable so %ENV doesn't seem to be carried across to the test object.
#!/usr/bin/perl
use strict; use warnings;
use Test::More qw(no_pl...