Skip to content

Instantly share code, notes, and snippets.

@derekgreer
Created January 14, 2011 23:50
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 derekgreer/780526 to your computer and use it in GitHub Desktop.
Save derekgreer/780526 to your computer and use it in GitHub Desktop.
[Subject(typeof (FluSectionResultGenerator))]
public class when_applicant_provides_information_indicating_flu_susceptibility : given_a_generator_context
{
Because of = () => Generator.Run(new[] {new Question("Do you have issues?") {Answer = true},});
It should_reflect_susceptibility_to_the_flu = () => FileSystemMock.Verify(x => x.Read( "a/b/c/susceptable.txt"));
}
[Subject(typeof (FluSectionResultGenerator))]
public class when_applicant_provides_no_information_indicating_flu_susceptibility : given_a_generator_context
{
Because of = () => Generator.Run(new[] {new Question("Do you have issues?") {Answer = false},});
It should_not_reflect_susceptibility_to_the_flu = () => FileSystemMock.Verify(x => x.Read("a/b/c/non_susceptable.txt"));
}
public abstract class given_a_generator_context
{
protected static Mock<IFileSystem> FileSystemMock;
protected static FluSectionResultGenerator Generator;
Establish context = () =>
{
FileSystemMock = new Mock<IFileSystem>();
Generator = new FluSectionResultGenerator(FileSystemMock.Object);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment