unit-testing

Is Boo a good choice for writing unit tests?

I'm developing in C# on the Castle stack. I'm new to unit testing, and I've heard that a more flexible language (than C#) might make writing tests easier. Do you think it is worth the time to learn Boo just for writing unit tests? We use the SharpDevelop IDE, so have Boo support available, and I've kind of been looking for an excuse to...

Using Sqlite InMemory DB for unittesting MSSQL-DB

Hallo, i am trying to implent this solution NHibernate-20-SQLite-and-In-Memory-Databases the only problem is that we have hbm's like this <class name="aTable" table="[dbo].[aTable]" mutable="true" lazy="false"> with [dbo] in the tablename because we are working with mssql and this does not work with Sqlite. i found also this postin...

Why should I use Test Driven Development?

Duplicate: Why should I practice Test Driven Development and how should I start? Is it worth to start TDD? For a developer that doesn't know about Test-Driven Development, what problem(s) will be solved by adopting TDD? [EDIT] Let's assume that the developer already (ab)uses a unit testing framework. ...

XNA mock the Game object or decoupling your Game

I was wandering if it's possible to mock a Game object in order to test my DrawableGameComponent component? I know that mocking frameworks need an interface in order to function, but I need to mock the actual Game object. edit: Here is a link to respective discussion on XNA Community forums. Any help? ...

How do unit testing for IgnoreRoute in ASP.NET MVC

In ASP.NET MVC, I can get information on unit testing for routes and custom routes, but I can not figure out how to do unit testing for IgnoreRoute. routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); Practical code is much appreciated. ASP.NET MVC Framework (Part 2): URL Routing ASP.NET MVC Tip #13 – Unit Test Your Custom Routes A...

Strategies to mock a webservice

I'm implementing a client consuming a webservice. I want to reduce dependencies and decided to mock the webservice. I use mockito, it has the advantage vs. EasyMock to be able to mock classes, not just interfaces. But that's not the point. In my test, I've got this code: // Mock the required objects Document mDocument = mock(Document.c...

Unit Testing Email Content

I'm usually one to say any piece of code no matter what it does, especially if it's runs in a production environment should be tested. I've been wondering, however, if dynamic email content should be an exception. It changes so often and is usually a pain to properly and fully test that I don't know if it's worth it. More often than no...

distributed/faster python unit tests

I have a lot of python unit tests for a project and it's getting to the point where it takes a long time to run them. I don't want to add more because I know they're going to make things slower. How do people solve this problem? Is there any easy way to distribute the test execution over a cluster? ...

How-to create a simple example Console application for developing separate classes for test driven development?

Hi all! My intend is to create a simple easily debuggable console application which will be the template ( or starting point ) for test driven developing single classes in C#. The purpose is to have a simple folder where this console app will reside and just copy paste the folder open the new project and start writing the new class. As s...

Unit Tests/TDD options that can be used for Delphi and FreePascal

I know of the existence of DUnit for Delphi win32. What I'm after is a library that works both on Delphi AND FreePascal. If that is not possible at all, I would really appreciate a list of all the options for one(Delphi) AND the other(FreePascal) ...

How do I separate unit testing from integration testing?

I am new to testing and mocking. I'm trying to test a business logic class which performs calculations, calls into the DAL and updates the database, and manages transactions. I'm using mocks to do unit testing, but how does full integration testing fit into all of this. Do I basically have the exact same tests, but use the real DAL or do...

Where should I put my JUnit tests?

I've got 2 questions about organising Unit tests. Do I have to put test to the same package as tested class, or can I organise tests in different packages? For example if I have validity and other tests, is it correct to split them into different packages, even if they are for same class? What about mock and stub classes? Shall I sepa...

Using MSTest with MFC

Is there anybody using MSTest to test MFC code? I created a managed C++ Test project and and can write unit tests within it but once I #include <afxwin.h> then I have problems. The code will compile and when it gets to running the tests, the UI hangs and none of the symbols will load. You cannot debug the tests either. If I remove the ...

Grouping JUnit tests

Is there any way to group tests in JUnit, so that I can run only some groups? Or is it possible to annotate some tests and then globally disable them? I'm using JUnit 4, I can't use TestNG. edit: @RunWith and @SuiteClasses works great. But is it possible to annotate like this only some tests in test class? Or do I have to annotate wh...

Unit testing with NSURLConnection

Hello! I want to test a piece of code that uses network (the NSURLConnection class, to be specific). The code (let’s call it NetworkManager) looks a bit like this: - (id) buildConnection { // some more code and then: return [NSURLConnection …]; } - (void) startNetworkSync { id connection = [self buildConnection]; //… }...

How do you test an asynchronous method?

I have an object that fetches XML or JSON over a network. Once this fetching is complete it calls a selector, passing in the returned data. So, for example I'd have something like: -(void)testResponseWas200 { [MyObject get:@"foo.xml" withTarget:self selector:@selector(dataFinishedLoading:)]; } I tried the route of implementing ...

What dynamic language can I use for .NET unit tests?

I am trying to write some complicated acceptance tests for my C# code. I notice that when I am writing my tests I am doing a lot of explicit casting to satisfy the C# compiler. I like the type-safety I get in my production code with a statically-typed language like C#, but for my tests I would be happy to use a dynamically-typed language...

.Net Test Automation

How to generate click on link in C# for automation testing? ...

Dependency Injection resolve and unit testing

Hi I'm trying to learn dependency injection and have come across a problem, when unit testing the application. I'm writing a console application and the container is created and initialized in Main(), it's available as a get-property in Program.Container, so anywhere in my application I can call Program.Container.Resolve<..>(). I have...

An best practice example of an MVP implementation of Unit Testing (in VB.Net)

Can anyone point me towards a complete scenario using MSTest,vb.net, with or without mocks,MVP (supervising controller) thanks ...