First time here? You are looking at the most recent posts. You may also want to check out older archives or the tag cloud. Please leave a comment, ask a question and consider subscribing to the latest posts via RSS. Thank you for visiting! (hide this)

TDD

There are 5 entries for the tag TDD

10 resources to learn Moq

Last week I described the stack I’ll be using to develop my new ASP.NET MVC project, and I said I was going to use RhinoMocks as mocking framework. Well, it later turned out that some tests were using RhinoMocks but most of them were using Moq and “Il Maestro” decided that the latter would be the mocking framework of choice. I never used it, so I started looking for some documentation online. And here I’m listing the best 11 links about Moq. http://code.google.com/p/moq/ – obviously, the starting point of it all. Download the binary, source and...

MSTest Tip: Double click to go to failing test

When you run a test suite, Visual Studio shows the results in a grid: the passing ones with the green icon and the failing one with the red icon. By default, if you double click on the line with the test, Visual Studio shows the details of the test, with the stack trace and the details of the exception. If you right click on the line and you select “Open Test” you will go to the test case, on the line that caused the error. But if you follow a TDD approach, you want to go straight the test with just...

Testing ASP.NET MVC P2

I'm playing a bit around with the ASP.NET MVC "MIX08 preview" and I wanted to use a different approach to testing the RedirectToAction method. SubText fellow Phil Haack wrote some sample tests back in December with the previous preview version of aspnetmvc, but I wanted to play around a bit so I wrote my own version. [TestMethod]public void AboutOverride(){ HomeControllerForTest controller = new HomeControllerForTest(); controller.About(); Assert.AreEqual("Index", controller.SelectedViewName, ...

Rhino Mocking NHibernate Expressions

A few days ago I wrote a post about how to test your business layer using Rhino Mocks. Last time I set an expectation on an method that accepts a normal int. Today I'll show how to work on something more complicated: a NHibernate Expression. How to Mock the FindOne(ICriterion[]) I've to test a method that returns a user given its username. 1: public User GetByUsername(string username) 2: { 3: User returnUser = 4: _repository.FindOne(Expression.Eq("EmailAddress", username)); ...

What convinced me to adopt a (kind of) Test Driven Design approach

I've to admit it: I never wrote many tests for the code I wrote. Probably one of the reason is that the last time I wrote something from scratch, with enough time to convince the other members of the team to try a new approach, was before the TDD became known to the general audience. I only wrote some test for small part of the code, or to expose some bugs and later fix them. But 2 months ago, I had to design from scratch a small web application: and again I didn't have the time to sit down, look around...