Skip to content

Instantly share code, notes, and snippets.

@agross
Created January 24, 2009 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agross/51573 to your computer and use it in GitHub Desktop.
Save agross/51573 to your computer and use it in GitHub Desktop.
public abstract class with_string_parser
{
protected static DateTime ParsedDate;
protected static IParser Parser;
protected Because of = () => { ParsedDate = Parser.Parse("2009/01/21"); };
}
public class when_a_date_is_parsed_by_the_infrastructure : with_string_parser
{
Establish context = () => { Parser = new InfrastructureParser(); };
It_should_behave_like a_second = () => new SecondaryBehavior();
}
public class SecondaryBehavior
{
protected static DateTime ParsedDate;
It should_parse_the_expected_date_second = () => ParsedDate.ShouldEqual(new DateTime(2009, 1, 21));
It_should_behave_like a_third = () => new NestedThirdBehavior();
}
public class NestedThirdBehavior
{
protected static DateTime ParsedDate;
It should_parse_the_expected_date_nested_third = () => ParsedDate.ShouldEqual(new DateTime(2009, 1, 21));
It is_not_implemented_nested_third;
[Ignore]
It is_ignored_nested_third;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment