Created
January 17, 2009 22:51
-
-
Save agross/48476 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public class When_a_message_header_with_an_empty_prefix_is_parsed : With_message_and_parser | |
{ | |
static When_a_message_header_with_an_empty_prefix_is_parsed() | |
{ | |
FileName = "Messages\\One level, empty quote prefix.txt"; | |
} | |
} | |
public abstract class With_message_and_parser | |
{ | |
protected static string Message; | |
protected static MessageModel Model; | |
protected static MessageParser Parser; | |
protected static string FileName; | |
protected static string Load(string messageFile) | |
{ | |
return File.ReadAllText(messageFile); | |
} | |
Establish context = () => | |
{ | |
Message = Load(FileName); | |
Parser = new MessageParser(" "); | |
}; | |
protected Because of = () => { Model = Parser.Parse(Message); }; | |
protected It should_return_one_section = () => Model.Sections.Count().ShouldEqual(1); | |
protected It should_set_the_send_date_in_the_header = | |
() => Model.Sections.First().Header.DateSent.ShouldEqual(new DateTime(2008, 12, 8, 18, 28, 00)); | |
protected It should_set_the_sender_email_in_the_header = | |
() => Model.Sections.First().Header.SenderEmail.ShouldEqual("[email protected]"); | |
protected It should_set_the_sender_name_in_the_header = () => Model.Sections.First().Header.SenderName.ShouldEqual("Foo Bar"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment