Category Archives: BDD

BDD and Parameterized testing

Although I really like Astels style BDD still use a lot of parameterized testing and though I should give you an example why, using Lets say we’re testing simple SPECIFICATION style rules, in BDD we might write: [Concerning(typeof(ValidEmailRule<TestEntity>))]public class When_using_rule_on_a_null_string : … Continue reading 

Also posted in Color Scheme, Visual Studio | 33 Comments

BDD – Files/Folders/Namespaces (BDD)

Files/FoldersOne thing that can be troublesome when moving to a BDD style approach is how to organize your files and folders, so far I’ve tried two approaches: One class in each file – So if you have When_associating_an_order_with_a_customer and When_associating_an_order_with_a_preferred_customer then … Continue reading 

Also posted in C#, Domain Driven Design, Domain Service, Presenter, Repository, View | 3 Comments

Encapsulation and thinking behaviorally

I’ve been reading quite a bit lately about setters and encapsulation, but for whatever reason, it never really “clicked” for me.  I thought I was developing behaviorally, as I’ve been using the Context/Specification style of BDD specifications for a while.  … Continue reading 


Arrange Act Assert and BDD specifications

With Rhino Mocks 3.5 just around the corner, I’ve started using it to create much more readable tests.  One of the things that always bothered me with Expect.Call, constraints and the like was that it mixed in the Arrange with … Continue reading 


Separation of Concerns by example: Part 4

In the last part, we finally broke out the caching and data access concerns from our original class.  The series so far includes: Separation of Concerns – how not to do it Separation of Concerns by example: Part 1 – … Continue reading 


PabloTV: Eliminating static dependencies screencast

Nature abhors a vacuum.  It turns out she also abhors static dependencies (I have my sources).  Static dependencies are the modern-day globals, often exposed through classes named “Helper”.  I’ve certainly been guilty of overusing static dependencies in the past, with … Continue reading 

| Leave a comment

Eliminating obscure tests

One of the purported benefits of unit tests and TDD in general is unit tests doubling as living documentation.  Unit tests are documentation in the form of executable client code demonstrating small units of behavior.  The idea is that if … Continue reading 

| Leave a comment

Converting tests to specs is a bad idea

When I first started experimenting with BDD, all the talk about the shift in language led me to believe that to “do BDD” all I needed to do was to change my “Asserts” to some “Shoulds”.  At the root, it … Continue reading 

| Leave a comment

NBehave + NSpec

So, quickly, I decided to go ahead and throw NSpec into the mix on top of NBehave.  Why not!  Here is what the example from my previous post would look like using NSpec: [Test, Story] public void Load_checkout_information() { CheckoutOrderDTO checkoutOrderDTO … Continue reading 

| Leave a comment

NBehave Experiment: MonoRail Controllers & Rhino Mocks

…whoever keeps His word, truly the love of God is perfected in him. By this we know that we are in Him. — 1 John 2:5 Well I decided it was finally time I took a look at NBehave as … Continue reading 

| Leave a comment