Created
May 19, 2010 06:07
-
-
Save follesoe/406014 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment