Skip to content

Instantly share code, notes, and snippets.

@philiplaureano
Forked from tathamoddie/gist:969952
Created May 13, 2011 04:07
Show Gist options
  • Save philiplaureano/969956 to your computer and use it in GitHub Desktop.
Save philiplaureano/969956 to your computer and use it in GitHub Desktop.
var testHarness = new TestHarness();
// The processors decide which methods should be replaced and how they should behave once the method is called
var consoleTestProcessor = new ConsoleTestProcessor();
testHarness.Processors.Add(consoleTestProcessor);
var fileSystemTestProcessor = new FileSystemTestProcessor();
fileSystemTestProcessor.AddMockFile(@"c:\foo.txt", "bar");
testHarness.Processors.Add(fileSystemTestProcessor);
var dateTimeProcessor = new DateTimeProcessor(new DateTime(2010, 01, 25));
testHarness.Processors.Add(dateTimeProcessor);
// IDEA: Clone the method from the lambda and run the method clone
testHarness.Run(() => {
new Foo().Bar();
});
Assert.AreEqual(@"Fizz
Buzz
FizzBuzz", consoleTestProcessor.OutputText);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment