public
Last active

  • Download Gist
BDD base class.cs
C#
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
// Tiniest BDD DSL/framework around?
// Licensed under MSPL/FreeBSD/ISC or any other OSS license you want
// Original idea from http://blog.kjempekjekt.com/2009/08/13/ultra-tiny-given-when-then-dsl-snippet/,
// turned into generic base class by Jonas Follesø.
 
public abstract class BDD<T> where T : BDD<T>
{
protected T Given { get { return (T)this; } }
protected T And { get { return (T)this; } }
protected T When { get { return (T)this; } }
protected T Then { get { return (T)this; } }
}
 
[Fact]
public void The_mismatch_exception_message_contains_information_about_the_mismatch()
{
Given.we_have_mismatch_exception_for_a_specific_comparison();
When.we_read_the_message_of_the_exception();
Then.it_tells_us_what_the_difference_is();
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.