public class when_an_automatically_resolved_instance_with_a_single_dependency_is_used_in_a_fixture :
InstanceContextSpecification<ClassWithSingleDependency>
{
private object actualResult;
private IDependency dependency;
private object expectedResult;
protected override void EstablishContext()
{
expectedResult = new object();
dependency = AutoDependency<IDependency>();
dependency.WhenToldTo(x => x.Invoke()).Return(expectedResult);
}
protected override void Because()
{
actualResult = Sut.Invoke();
}
[Observation]
public void should_be_able_to_verify_calls_made_to_the_dependency()
{
dependency.WasToldTo(x => x.Invoke());
}
[Observation]
public void should_execute_the_configured_behavior_on_the_dependency()
{
actualResult.ShouldBeEqualTo(expectedResult);
}
}
This little feature was added to the trunk today. Yes, no CreateSut() call. You can omit it for most of the simple scenarios. You can [...]
What’s the importance of Should in BDD? Why isn’t it called Must, Need to or Will? It’s one of those subtle psychological things . . .
The main reason Dan North decided to use Should instead of all other possibilities is, that Should implies that you can always question the behavior of your system. It isn’t [...]
Last week I had a little discussion on the german ALT.net mailing list in which I commented on a code example of a spec that wording in a BDD spec is of vital importance to BDD and therefore should be chosen very carefully. With this post I would like to clarify a bit what I [...]
I’ve been doing BDD with the “context/specificationt”- style for about 4 months now. Examples for this style are MSpec, NSpec or my little framework called xUnit.BDDExtensions.
What bothers me lately is that this style mixes context and behavior under test into one fixture class name, which can be extremely long because of that. An [...]
xUnit.BDDExtensions is a little framework build on top of xUnit which enables a BDD style of testing with xUnit.
Besides an emphasis on a “test case class per fixture” organization scheme for tests, AAA (Arrange, Act and Assert) style of writing tests and left to right assertions, this framework also provides Rhino.Mocks integration out of the [...]
Because of several requests I uploaded the little BDD extension I recently wrote for xunit. It’s basically a port of the framework JP Boodhoos currently uses in his famous Nothing but .Net bootcamps (he’s using MbUnit).
So here it is. Any feedback is appreciated . . .
Yesterday was an interesting evening. I tried to pinpoint the problem between the little BDD framework I used and the Resharper addin for xUnit.
A short description of my problem
I’m using a test-case-class-per-fixture organization and the template method pattern for writing tests in the AAA scheme. Besides that I use a specialized FactAttribute in order to [...]
My current tool of interest is XUnit. For those of you who haven’t heard of it it’s a relatively new unit testing framework from Brad Wilson and the original author of NUnit 2.0, James Newkirk. You can find it here.
Some of the things I really like about it:
It has a set of .NET 3.0 Extension [...]
One of the positive things of being ill and staying at home is having time to look into stuff I always wanted to look into but never actually had the time to. A good example for this is Behavior Driven Development or in short BDD.
BDD is described by its creator Dan North as an enhancement [...]