unit-testing

What is your favorite Delphi mocking library?

I want to start using mock objects on my Delphi projects. After a quick google I've found those: Delphi Mock Wizard PascalMock So my question is what one is your favourite and why? ...

Creating new ASP.Net MVC project - Unit Test Dialog does not show up

When I create a New Project of type ASP.Net MVC Web Application, I expect the dialog for unit test applications to show up, but it does not. I cannot find the Unit Test App among the product types I can create either. How do I set up my VS so that the dialog shows up? I have installed Visual Studio 2008, .Net Framework 3.5 SP1 and ASP.N...

Unit Testing and VB.NET

Where can I find either literature or video demonstration of unit testing applications using VB.NET? As a novice/hobbyist programmer I would like to build a solid foundation in developing applications using the unit testing methodology. ...

How can one mock/stub python module like urllib

I need to test a function that needs to query a page on an external server using urllib.urlopen (it also uses urllib.urlencode). The server could be down, the page could change; I can't rely on it for a test. What is the best way to control what urllib.urlopen returns? ...

Unit Test to verify object getting deallocated

What I am looking for is a way to programmatically verify a target object has been deallocated. Currently I have an NSLog statement in the dealloc methods of the objects I wish to observe. The unit testing framework is from the Google Toolbox for the mac, and it working nicely. I am just not certain how to frame this particular test. ...

Can I unit test the DOM?

Hello, We have a Ruby on Rails app that uses some javascript in the views. Since we have good test coverage on the rest of the app, we want to continue that here. The js we use manipulates the DOM to show/hide divs and perform incremental searching for a combobox selecting from a table. Does anyone know of ways to test DOM manipulati...

Visual C++ TDD setup

I haven't worked much with Visual Studio before. I've started a personal project in my spare time and I would like to use test-driven development since it has been a huge benefit to me in my Java development. I started this project quite a while ago, and I used CppUnit. I know there are probably other frameworks that are better, but this...

How do I unit test object serialization/deserialization in VB.NET 1.1?

I am looking for example code that provides a unit test to serialize and deserialize an object from a memory stream. I have found examples using C# 2.0, however my current project uses VB.NET 1.1 (don't ask me why...), so the solution can not use generics. I am also using the NUnit framework for the unit tests. Thanks! ...

What is the best way to compare XML files for equality?

I'm using .NET 2.0, and a recent code change has invalidated my previous Assert.AreEqual call (which compared two strings of XML). Only one element of the XML is actually different in the new codebase, so my hope is that a comparison of all the other elements will give me the result I want. The comparison needs to be done programmatica...

Is there a prevailing unit testing framework for the .NET Compact Framework?

I have plenty of experience with NUnit and MBUnit, but I'm new to .NET Compact Framework development and I'd like to get off on the right foot. Is there a prevailing unit testing framework for the .NET Compact Framework, and if so, what is it? ...

Why do I need a mocking framework for my unittests?

Recently there has been quite some hype around all the different mocking frameworks in the .NET world. I still haven't quite grasped what is so great about them. It doesn't seem to be to hard to write the mocking objects I need myself. Especially with the help of Visual Studio I quickly can write a class that implements the interface I w...

How do I integration testing to my code written using the ASP.NET Provider Model?

I'm fairly new to unit testing. I have a site built in the 3-tier architecture, UI -> BLL -> DAL. And I used the asp.net Provider Model, so by making changes to web.config I can switch to DAL dll to target different data sources, to be complete the DAL is written with Entity Framework. Now, my question is how do I unit test my BLL? I...

Looking for a better JavaScript unit test tool

Let's consider the state of JavaScript unit tests and testing tools. JsUnit We already use it for some of our js code. Pros can be invoked from an ant build file launches browser to run the tests Eclipse plug-in Cons launches browser to run the tests Does not support js file to write the unit test code: it has to be embedded inside...

Automatically Unit Test Example Code

My team is responsible for the development of an API for a large system that we also write. We need to provide example code so that other developers using our API can learn how to use it. We have been documenting the code using the xml document comments. eg. /// <summary>Summary here</summary> /// <example>Here is an example <code>exam...

Can (or should) I mock methods on the object being tested other than the method being tested?

I have a class like so: public class ClassA { public bool MethodA() { //do something complicated to test requiring a lot of setup } public bool MethodB() { if (MethodA()) //do something else //do something else endif } } I have tests for MethodA and wan...

Unit Testing SiteMapNode

Does anyone know how to unit test SiteMapNode? We’re building some custom navigation controls, which renders unordered html lists from Site Maps with custom attributes. I’m trying to follow a test first approach but am finding that SiteMapNode has internal dependencies on HttpContext. To traverse the site map file it insists on using a ...

Why didn't unit testing work out for your project?

Give short concrete answer: why unit testing did NOT work out for you (your project). Will you particularly try again on a different project? ...

UnitTest how do you organise your testing files?

Currently, I am splitting all my tests by package (projects). So if I have 12 projects, I will create 1 more project for Unit Test with 12 classes that will test all my package. Do you do the same way or do you have 1 testing class by class? How do you organize all your test? ...

Unit testing method that uses UI controls.

I'm currently writing some methods that do some basic operations on form controls eg Textbox, Groupbox, these operations are generic and can be used in any application. I started to write some unit tests and was just wondering should I use the real form controls found in System.Windows.Forms or should I just mock up the sections that I...

Initialize object to test in SetUp or during the test method?

I was wondering whether the object to test should be a field and thus set up during a SetUp method (ie. JUnit, nUnit, MS Test, …). Consider the following examples (this is C♯ with MsTest, but the idea should be similar for any other language and testing framework): public class SomeStuff { public string Value { get; private set; } ...