unit-testing

Is there a case for conducting unit tests (and integration or regression if applicable) with Groovy?

Is it just hype about testing Java classes with Groovy rather than using Mockito, Easymock etc? What's your experience and ease of application? ...

Qt: What unit-testing framework?

I am just starting up a new project that needs some cross-platform GUI, and we have chosen Qt as the GUI-framework. We need a unit-testing framework, too. Until about a year ago we used an in-house developed unit-testing framework for C++-projects, but we are now transitioning to using Google Test for new projects. Anyone have any expe...

Fixing the error: Creation of the private accessor for 'Microsoft.VisualStudio.TestTools.TypesAndSymbols.Assembly' failed

I'm creating unit tests for a Windows Forms application. One of my methods is an event-handler for a form (I don't know if this is the source of my problem): private void ImportButton_Click(object sender, System.EventArgs e) { // blah blah } Now when I attempt to create a unit test for this method via right-clicking the source ->...

Mocking / Testing a core object in my system

I've been asked to work on changing a number of classes that are core to the system we work on. The classes in question each require 5 - 10 different related objects, which themselves need a similiar amount of objects. Data is also pulled in from several data sources, and the project uses EJB2 so when testing, I'm running without a con...

Silverlight Unit Testing

I've searched for this info and see similar questions, but not one that matches very closely to this. If I missed one, I apologize. I was hoping that you'd be able to point me in a direction. I'm working on a Silverlight based project and my team is finally moving toward implementing unit testing. I and another memeber of my team are...

Method with Object argument won't accept anything other than an Object

We have a VB.net function with the following signature in class InitializerFactory: Public Shared Function Create(ByRef ui As Object) As IModeInitializer I'm attempting to test this function by passing in a mock of ui (using Rhino Mocks): MainForm ui = mocks.StrictMock<MainForm>(); IModeInitializer item = InitializerFactory.Create(re...

Unit Testing File I/O

Reading through the existing unit testing related threads here on Stack Overflow, I couldn't find one with a clear answer about how to unit test file I/O operations. I have only recently started looking into unit testing, having been previously aware of the advantages but having difficulty getting used to writing tests first. I have set ...

How to reference javascript files from another project?

Hi all: I'm currently trying to write some unit test on some javascript files. My first and foremost problem with that is that my test files are in a different project than the actual javascript files. I'm running VS2008, and in my test project, I have included a reference of the actual project file. Assuming I'm writing my tests in ...

Hudson job with Gallio tests reports "No tests"

I am using Hudson as a CI server to build a few different .Net 3.5 projects. The actual build stuff works great. However, I run MbUnit v2 tests using Gallio.Echo as part of the build, and while the tests seem to run fine, Hudson claims that there were no tests run. I have the following build step right after the "Build a Visual Studio ...

VSTestHost is crashing and would not work anymore

For my project I am using the integrated Visual Studio unit-testing framework but I am having some issues that I never saw before. One of my classes is causing VSTestHost to crash. So first I though it was because there was a bunch of code causing a stack overflow. What is really strange is that now, even if I create a new project or us...

When developing Visual Studio add-ins, what testing options are there beyond manual testing?

I'm in the process of developing a Visual Studio add-in for a project at work, and have found debugging and testing it to be pretty tedious. So far, it appears to require the launching of a second instance of Visual Studio and manual execution of the add-in code. What techniques and/or tools are available for automating this sort of ad...

C#: Unit testing classes of web application...

I'm working on a web server application that handles requests received from mobile phones. I have request adapters which adapts requests from the phone in request classes I use in the rest of the app. What every request adapter does is that it accesses one object in a session and changes one of its properties. Now, the question: I want t...

MSTest & Silverlight Unit Test Framework Tutorials

I'm sorry if this appears elsewhere, it may be that my Google-Fu is failing me. I'm in the process of reading Roy Osherove's The Art of Unit Testing and am thrilled to be able to start doing some Test-First work on my current project. Roy's book uses NUnit as the basis for it's training. I find myself in the position of needing to use...

Testing Django Models with FileField

I'm trying to make the transition to testing with Django. This is the particular model in question for testing: class Media(models.Model): file = models.FileField(upload_to='upload',) thumbnail = models.ImageField(upload_to='upload', blank=True,) # ... PART 1: How do I deal with these FileFields? (Particularly in the se...

Is there any open source mocking framework resembling TypeMock?

TypeMock is too expensive for a hobbist like me :) Moq or the next version of RhinoMocks have no plans on listening to the profiling API, why is that? EDIT: This enables features such as: Mocking non-virtual methods and properties (!). Mocking browser environments. simpler syntax which is less fragile (and not having to go trough...

Which Unit Test framework should I start with for C# in Visual Studio 2008? (Windows Forms app)

Hi, QUESTION - If I'm starting a Windows Forms application in C# using Visual Studio 2008, which unit testing framework should I use? There seems to be one build into VS2008? Or should I look into something like NUnit? Or is NUnit what is used in VS2008 under the bonnet? What's the most popular. Would be good to have something th...

Running nUnit tests in a multithreaded fashion

Is it possible to run nunit tests in a multithreaded fashion? Is there any runner which can provide this? Before someone jump on "unit test" concept, let me explain: These are not unit tests we are using nunit for functional / integration testing as well, and some of those tests are incredibly slow, got lots of wait state. Therefore mul...

How to unit test an email client

I'm working on a desktop email client right now, and I want to unit test my backend. However, I can't see a way to make that work. In order for my code to work, it has to connect to a working mail server. Unless I tie my unit tests to an email account, and make sure that account matches the state my tests expect, I don't see how I can ma...

How to test business logic (Doman Model Rules) while using ADO.net entity framework?

I am trying to test that the business rule of not allowing to share the same space with a user twice. Below is the method being tested. The line having the issue is marked below. public void ShareSpace(string spaceToShare,string emailToShareIt) { SharedSpace shareSpace = new SharedSpace(); shareSpace.InvitationCode = Guid.NewGuid()...

How can I unit test Perl functions that print to the screen?

I'm trying to use Test::More to unit test Perl functions that print to the screen. I understand that this output may interfere with tools such as prove. How can I capture this output so I can print it with diag(), and also run tests on the output itself? ...