Created
April 23, 2011 13:02
-
-
Save johnnonolan/938588 to your computer and use it in GitHub Desktop.
FakeConcreteClass
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 TestingAnAbstractClassWithAFake | |
| { | |
| private class FakeConcreteInstance : MyAbstractClass | |
| {} | |
| [Fact] | |
| public void Should_return_correct_message() | |
| { | |
| var fake = new FakeConcreteInstance(); | |
| var result = fake.MyMethodOnAbstractClass("fish"); | |
| Assert.Equal("I like fish in an abstract sense.", result); | |
| } | |
| } | |
| public class MyAbstractClass | |
| { | |
| public string MyMethodOnAbstractClass(string input) | |
| { | |
| return "I like " + input + " in an abstract sense."; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment