unit-testing

Automated Web Service Testing

I would like to do some integration testing of a web service from within NUnit or MBUnit. I haven't delved into this too deeply yet, but I am pretty sure I will need to spin up WebDev.WebServer.exe within the "unit test" to do this. (I know it's not really a unit test). Yes, I can test the underlying objects the web service uses on thei...

ASP.Net MVC and nUnit

I have nUnit installed. I have VS2008 Team Edition installed. I have ASP.Net MVC Preview 4 (Codeplex) installed. How do I make Visual Studio show me nUnit as a testing framework when creating a new MVC project? At this point I still only have the Microsoft Testing Framework as a choice. Update: I installed nUnit 2.5, but still wit...

Unit-Testing Databases

This past summer I was developing a basic ASP.NET/SQL Server CRUD app, and unit testing was one of the requirements. I ran into some trouble when I tried to test against the database. To my understanding, unit tests should be: stateless independent from each other repeatable with the same results i.e. no persisting changes These re...

What's the best mock framework for Java?

What's the best framework for creating mock objects in Java? Why? What are the pros and cons of each framework? ...

How do I format Visual Studio Test results file (.trx) into a more readable format?

Have just started using Visual Studio Professional's built-in unit testing features, which as I understand, uses MS Test to run the tests. The .trx file that the tests produce is xml, but was wondering if there was an easy way to convert this file into a more "manager-friendly" format? My ultimate goal is to be able to automate the uni...

Senior Developers and Unit Tests - Required? Are they allowed to use lackeys?

Should senior developers be exempt from unit testing - or should they be allowed to use lackeys to implement them? What's the best way to motivate people who are not used to using unit testing techniques to adopt them? ...

Is there a site for detailed unit testing samples?

Is there a site for unit testing as RefactorMyCode for refactoring? I think it would be a great help for beginners like me. ...

Where can i find extended HTML reporters for Simpletest?

I am using Simpletest as my unit test framework for the PHP site I am currently working on. I like the fact that it is shipped with a simple HTML reporter, but I would like a bit more advanced reporter. I have read at the reporter api documentation, but it would be nice to be able to use an existing reporter, instead of having to do it ...

Beginning TDD - Challenges? Solutions? Recommendations?

OK, I know there have already been questions about getting started with TDD.. However, I guess I kind of know the general concensus is to just do it , However, I seem to have the following problems getting my head into the game: When working with collections, do will still test for obvious add/remove/inserts successful, even when based...

Unit testing IHttpModule

How do you unit test a HttpModule in asp.net given that HttpApplication and HttpContext do no implement an interface ? ...

SQL Server - testing the database

What tools are people using for testing SQL Server databases? By this I mean all parts of the database - configuration, tables, column type, stored procedures, constraints. Most likely, there is no one tool to do it all. ...

Best way to unit test ASP.NET MVC action methods that use BindingHelperExtensions.UpdateFrom?

In handling a form post I have something like public ActionResult Insert() { Order order = new Order(); BindingHelperExtensions.UpdateFrom(order, this.Request.Form); this.orderService.Save(order); return this.RedirectToAction("Details", new { id = order.ID }); } I am not using explicit par...

How to bring a new hire up to speed on an existing project?

My boss hired a new dev right out of CompSci onto a project with a fair amount of technical debt. It will be my task to get this guy up to speed and making a decent contribution ASAP. Any suggestions on how best to do this? Any first hand experience on how precisely not to do it? My instincts are to do some code reviews on code written ...

How should I test a method that populates a list from a DataReader?

So I'm working on some legacy code that's heavy on the manual database operations. I'm trying to maintain some semblance of quality here, so I'm going TDD as much as possible. The code I'm working on needs to populate, let's say a List<Foo> from a DataReader that returns all the fields required for a functioning Foo. However, if I want ...

Is it possible to find code coverage in ColdFusion?

I am trying to be a "good" programmer and have unit tests for my ColdFusion application but haven't been able to find a code coverage tool that can tie into the test that I'm using. For those of you who do unit tests on your ColdFusion code, how have you approached this problem? ...

How to unit test an object with database queries

I've heard that unit testing is "totally awesome", "really cool" and "all manner of good things" but 70% or more of my files involve database access (some read and some write) and I'm not sure how to write a unit test for these files. I'm using PHP and Python but I think it's a question that applies to most/all languages that use databa...

ASP.NET - How do you Unit Test WebControls?

Alright. So I figure it's about time I get into unit testing, since everyone's been banging on about it for long enough. I've installed NUnit and gone through a few "intro to unit testing" type tutorials. I'm currently putting together a small framework to help with the rebuild of one of our web apps, so I've created a VS2008 project ...

Assert action redirected to correct action/route?

How do I exercise an action to ensure it redirects to the correct action or route? ...

Random data in Unit Tests?

I have a coworker who writes unit tests for objects which fill their fields with random data. His reason is that it gives a wider range of testing, since it will test a lot of different values, whereas a normal test only uses a single static value. I've given him a number of different reasons against this, the main ones being: random ...

Mocking Asp.net-mvc Controller Context

So the controller context depends on some asp.net internals. What are some ways to cleanly mock these up for unit tests? Seems like its very easy to clog up tests with tons of setup when I only need, for example, Request.HttpMethod to return "GET". I've seen some examples/helpers out on the nets, but some are dated. Figured this would b...