Last active
August 29, 2015 14:06
-
-
Save hmemcpy/9f47ae12d88b4ab38439 to your computer and use it in GitHub Desktop.
ATDD style tests with BDDfy!
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
| private const string program = @" | |
| /* 1 */ class Person | |
| /* 2 */ { | |
| /* 3 */ public int _age = 22; | |
| /* 4 */ public int Age { get { return _age; } set { _age = value; } } | |
| public override string ToString() { return ""hi""; } | |
| /* 5 */ } | |
| /* 6 */ | |
| /* 7 */ class Program | |
| /* 8 */ { | |
| /* 9 */ static void Main() | |
| /* 10 */ { | |
| /* 11 */ Person p1 = new Person(), p2 = new Person(); | |
| /* 12 */ System.Diagnostics.Debugger.Break(); | |
| /* 13 */ p1.Age = 9; | |
| /* 14 */ } | |
| /* 15 */ } | |
| "; | |
| [TestMethod] | |
| [HostType("VS IDE")] | |
| public void AddSetterBreakpoint_WorksWithRegularProperty() | |
| { | |
| this.Given(s => s.GivenTheProgram(program)) | |
| .When (s => s.WeRunTheProgram()) | |
| .And (s => s.WeEvaluate("p1")) | |
| .And (s => s.AndGoToItsMember("Age")) | |
| .And (s => s.AndAddASetterBreakpointOnIt()) | |
| .Then (s => s.WeHitF5AndBreakOnLine(4)) | |
| .BDDfy(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment