unit-testing

Is there a C++ unit testing framework plugin available for NetBeans?

I'm starting a new project and my company has standardized development on NetBeans. I need to do unit testing, though, and can't find a unit testing plugin for C++. As I said, it's a new project, so I'm open to trying any C++ unit testing framework. EDIT: I've decided on CppUnit, since I'm very familiar with JUnit and the learning cu...

Outputting data from unit test in python

If I'm writing unit tests in python (using the unittest module), is it possible to output data from a failed test, so I can examine it to help deduce what caused the error? I am aware of the ability to create a customized message, which can carry some information, but sometimes you might deal with more complex data, that can't easily be ...

Can we use JUNIT for Automated Integration Testing?

How do you automate integration testing? I use JUnit for some of these tests. This is one of the solutions or is totally wrong? What do you suggest? ...

Passing a paramter/object to a ruby unit/test before running it using TestRunner

I'm building a tool that automates a process then runs some tests on it's own results then goes to do some other stuff. In trying to clean up my code I have created a separate file that just has the test cases class. Now before I can run these tests, I have to pass the class a couple of parameters/objects before they can be run. Now the...

Are you really using unit tests?

I have been involved in a lot of projects, both old and new, and one thing that they have in common is that almost none of them have been using unit testing. I prefer to use it, but often the customer isn´t ready to pay for that, and suppose that the code just works as it should. So, do you use unit testing in your projects, or do you r...

Mock filesystem in integration testing

I'm writing a ruby program that executes some external command-line utilities. How could I mock the filesystem from my rspec tests so that I could easily setup some file hierarchy and verify it after testing. It would also be best to be implemented in ram so that tests would run quickly. I realize that I may not find a portable solutio...

How to unit test a grid with paging

A common web UI design is to display a sortable grid (GridView, ListView, DataGrid) with paging. That is, the user can click on any column header to cause the records to be sorted in ascending or descending order on that column's data. And, the user can navigate among the pages of, say, 10 records at a time. There may be millions of da...

Running unit tests on Team Foundation Server (TFS) builds

What are the steps to get Team Foundation Server running unit tests when a given build runs? What are the caveats / pitfalls / workarounds a dev or sysadmin should be aware of when setting up a TFS server to do this for the first time? What are common troubleshooting steps for unit test problems during builds? ...

How do you unit test a FileSystemWatcher event?

I am working on a system that processes documents that are dumped into a target directory. I pick up the files by detecting the FileSystemWatcher OnChanged event. As part of a unit test, how should I go about automating this? How should I organize the input files and the output files that get compared to verify that the transformation...

Looking for *small*, open source, c# project with extensive Unit Testing

(I asked this question but did not receive much response. It was recommended that I ask the same question with regards to C#. ) I am a VB.NET developer with little C# experience (yes, I know I need to write more in C#), looking for small open source projects that demonstrate high unit testing coverage from which to learn. I'm looking f...

How can I integrate a virtual machine into my automated unit tests in Visual Studio?

I've got some legacy software that I'd like to involve in an automated unit test (for testing network protocol compatibility) and because this software is old and runs in an outdated environment I'd like to encapsulate it in a virtual machine. What is the best way to control a virtual machine from a Visual Studio unit test? Once I have t...

Moq Expect On IRepository Passing Expression

I am using this code to verify a behavior of a method I am testing: _repository.Expect(f => f.FindAll(t => t.STATUS_CD == "A")) .Returns(new List<JSOFile>()) .AtMostOnce() .Verifiable(); _repository is defined as: private Mock<IRepository<JSOFile>> _repository; When my test is run, I get this exception: Expression ...

Does C1 code coverage analysis exist for Ruby?

I'm currently using Rcov to get C0 code coverage analysis for a rails project that I'm working on. However, those results are practically meaningless- I have 100% coverage according to rcov (as it only covers C0 analysis) and I've barely written half the test cases for the functionality that exists thus far. I'm used to the useful resu...

How to reinitialize static finals while unit testing

I am writing unit tests for a class, which has a static final variable. However, since the state of the static final var is modified in each test, I need some way to reinitialize it. How would this be possible? Would i need to use some sort of a custom classloader? The variable is initialized as - static final CountdownLatch latc...

PHPUnit filenaming conventions

I'm just starting to try out phpunit on some existing code. The naming convention we use is that the MyClass class should be in MyClass.class.php. PHPUnit seems to require that the file should be called MyClass.php. Is there any way around this? I noticed it while trying to generate a skeleton test class: phpunit --skeleton-test MyCl...

Is there a way to use pre-compiled headers in VC++ without requiring stdafx.h?

I've got a bunch of legacy code that I need to write unit tests for. It uses pre-compiled headers everywhere so almost all .cpp files have a dependecy on stdafx.h which is making it difficult to break dependencies in order to write tests. My first instinct is to remove all these stdafx.h files which, for the most part, contain #include ...

How to parametrize a test using cppunit

We are using cppunit, i am trying to run the same test using different parameters, running a loop inside the test is not a good option as any failure will abort the test. I have looked at TestDecorator and TestCaller but neither seem to really fit. Code samples would be helpful. Thanks. ...

differences between 2 JUnit Assert classes

Hi, I've noticed that the JUnit framework contains 2 Assert classes (in different packages, obviously) and the methods on each appear to be very similar. Can anybody explain why this is? The classes I'm referring to are: junit.framework.Assert and org.junit.Assert. Cheers, Don ...

Where do you take mocking - immediate dependencies, or do you grow the boundaries...?

So, I'm reasonably new to both unit testing and mocking in C# and .NET; I'm using xUnit.net and Rhino Mocks respectively. I'm a convert, and I'm focussing on writing behaviour specifications, I guess, instead of being purely TDD. Bah, semantics; I want an automated safety net to work above, essentially. A thought struck me though. I ...

What unit tests should be written for simple POCO domain objects?

So standard Agile philosophy would recommend making your domain classes simple POCOs which are Persisted using a separate proxy layer via data access objects (like NHibernate does it). It also recommends getting as high unit test coverage as possible. Does it make any sense to write tests for these simple POCO objects? Say I have a c...