unit-testing

testing an internal class

how to write unit tests to internal classes ??? ...

Team Foundation Server and MbUnit Testing

I'm really new to TFS Server and MbUnit. What steps do you need to do to make the builds on TFS run your MbUnit tests? ...

Rhino Mock and Mock in general

Is there any place or any one out there who can explain how this works in plain English instead of "defining terms in terms of themselves"? ...

How does unit testing work when the program doesn't lend itself to a functional style?

I'm thinking of the case where the program doesn't really compute anything, it just DOES a lot. Unit testing makes sense to me when you're writing functions which calculate something and you need to check the result, but what if you aren't calculating anything? For example, a program I maintain at work relies on having the user fill out ...

Using PHPUnit in Zend Framework version 0.7

We have an application developed using Zend Framework preview version 0.7. Now I would like to write unit test its controllers / logic files. The logic mostly deals with the database and for database I am using my own wrapper. Did anybody try unit testing an application on top of Zend Framework version 0.7 ? ...

Creating Unit Tests in VS2008, unnecessary references?

Creating Unit Tests in VS2008 (rightclick, create unit tests) causes a lot of references to be added to my testproject. These are the same references that the project being tested is using. Why is this necessary? Is there an option somewhere to turn it off? ...

Unittest ActionFilter

There is an ActionFilter on my controller-class. The OnActionExecuting method gets called, when an action of the controller is called in a web application. Now I call the Action in a UnitTest: NiceController niceController = new NiceController(); ActionResult result = niceController.WhateverAction(); Is there a way to have th...

Understanding unit test constraints and NUnit syntax helpers

Me and a colleague are starting a new project and attempting to take full advantage of TDD. We're still figuring out all the concepts around unit testing and are thus far basing them primarily on other examples. My colleague recently brought into question the point of the NUnit syntax helpers and I'm struggling to explain their benefit...

long long alignment problem (MSVC vs. GCC)

I'm writing C cross-platform library but eventually I've got error in my unittests, but only on Windows machines. I've tracked the problem and found it's related to alignment of structures (I'm using arrays of structures to hold data for multiple similar objects). The problem is: memset(sizeof(struct)) and setting structures members one ...

SimpleTest: How to assert that a PHP error is thrown?

If I am correct, SimpleTest will allow you to assert a PHP error is thrown. However, I can't figure out how to use it, based on the documentation. I want to assert that the object I pass into my constructor is an instance of MyOtherObject class Object { public function __construct(MyOtherObject $object) { //do something with...

Practice Examples Testing C# code

I've read about unit testing and heard a lot of hullabaloo by others touting its usefulness, and would like to see it in action. As such, I've selected this basic class from a simple application that I created. I have no idea how testing would help me, and am hoping one of you will be able to help me see the benefit of it by pointing out...

How can I run django unit tests (through manage.py) faster

As I'm developing unit tests for my django application I find myself running manage.py test over and over and over again. I'm using a MySQL backend and have many models in the project, so the ramp up time to create all of the test databases is about 30 seconds. How can I use make each unit test faster by keeping the database tables c...

What's the Point of Selenium?

Ok, maybe I'm missing something, but I really don't see the point of Selenium. What is the point of opening the browser using code, clicking buttons using code, and checking for text using code? I read the website and I see how in theory it would be good to automatically unit test your web applications, but in the end doesn't it just tak...

What test scenarios are necessary and sufficient to exhaustively black box test a recurring appointment model?

I have a django model for an appointment in a calendar that I am attempting to write a very comprehensive test driver for. The recurring appointment occurs at some point in time and can either run on infinitely or recur for a fixed number of times. The appointment mirrors the functionality available for a Google Calendar appointment (...

What leads to a no suitable image found error on Mac OS X?

I followed Chris Hanson's advice about debugging framework unit tests in Xcode 3.1, but when trying to run the custom executable, the program crashes, stating the below error message [substituted $(BUILD_PRODUCTS_DIR) for the real location of the build products]. 2009-03-02 19:56:03.414 otest[28059:10b] Error loading $(BUILD_PRODU...

Tests suddenly erroring out. Anyone seen this error?

Ruby 1.8.6, Rails 2.2.2, OS X Tiger My Test::Unit tests started returning the error below. The relevant line seems to be: `load_missing_constant': Expected /Users/ethan/project/mtc/webcalendars/app/models/calendar.rb to define Calendar (LoadError) The file mentioned, calendar.rb looks fine. I can't find any errors in it. I trie...

Do you concentrate more on unit, integration or acceptance tests?

Most gigs I end up at either have little or no unit tests. Typically what are described as the unit tests are actually integration tests and will be rarely run from the developers machine. I usually start my evangelism by preaching the difference between the two and try to get people to write very focussed unit tests and leave the inte...

Can you group unit tests within a single testproject in VS2008?

Can you group unit tests within a single testproject in VS2008? For instance - test1 and test2 belongs to group A. Test4 and test5 belongs to group B. I don't want the tests in group B to run unless I explicitly select them. This is because not all tests are supposed to be included in the automatic testing. EDIT : Rephrasing second pa...

Visual Studio 2008 Test Sets

Is it possible to group tests together so I can run a subset of all tests available? ...

How do you test code that is not a model or controller

I have a class defined in a file my Rails project's lib dir that will implement a bunch of utility functions as class methods. I'd like to write tests against those methods using Test::Unit and have them run as part of the project's regular testing routine. I tried sticking a file at the top level of the test dir... require 'test_helpe...