The Joy of Moq - Multiple Interfaces

A few weeks ago I wrote about how my team has been making the switch to Moq over NMock; since then, we really haven’t looked back. Recently I had cause to use a couple of Moq’s features that reinforced the decision to make the switch: partial mocking, and mocking an object that implements multiple interfaces. [...]

 
NUnit Doh: Setup != TestFixtureSetup

In the continuing trend of realized mistakes this week, we’ll be reviewing another error I made in code earlier this year as it relates to test setup. The title says it all: Setup != TestFixtureSetup.   The Scenario One of our new projects has achieved a high level of coverage that’s been maintained from the [...]

 
A Unit Test You Should Never Write

I was revisiting some code from several months ago and found some tests similar to the below. [Test] public void CanReadAndWriteAllPropertiesTest() { SomeObject so = new SomeObject { SomeIntProperty = 1, SomeStringProperty = “hi”, SomeBoolProperty = false, SomeObjectProperty = new Object() }; Assert.That(so.SomeIntProperty, Is.EqualTo(1)); Assert.That(so.SomeStringProperty, Is.EqualTo(“hi”)); Assert.That(so.SomeBoolProperty, Is.False); Assert.That(so.SomeObjectProperty, Is.Not.Null); } I remembered why I [...]

 
NHibernate vs. MyBatis.NET - Saving Entities, Part 1

Continuing with our series of comparisons between NHibernate and MyBatis.NET, we will be looking at how to actually persist our data. We will build on the code we have developed in both this series and the original MyBatis.NET one, which can be found here and here. The first part of this comparison will cover the [...]

 

In homage to Rob Conery’s “Vim Kata One,” I came up with my own little ditty, to be performed in any other text editor known to man other than Vim. Even a Visual Studio code window. Type each of these lines, and also do what they say: I will write a line and hit Enter [...]

 
Yet Another .NET Mocking Framework

That’s right, yet another .NET mocking framework. Given that my team is making the transition from NMock to Moq for a variety of reasons, I most definitely wasn’t looking for another such framework. Then I read one of Roy Osherove’s tweets: Pretty compelling statement coming from Roy, and in light of my recent conversion to [...]

 
NHibernate & Many-to-Many Relationships

Our next step in our exploration of some of the differences between NHibernate and MyBatis.NET takes us to map composition. In MyBatis.NET, this is a way to reuse defined maps in a DRY way; the post can be found here. As usual, we will be building on the code base we’ve build in this series; [...]

 
NHibernate vs. MyBatis.NET - Type Conversions & Type Handlers

Continuing in our series of comparisons between NHibernate and MyBatis.NET, we will reprise our take on simple type conversions and type handlers from an NHibernate perspective, comparing how said functionality stands up to what is offered in MyBatis.NET. The prior post that covered type conversions and type handlers in MyBatis.NET can be found here. As [...]

© 2011 Musings of the Bare Bones Coder Suffusion theme by Sayontan Sinha