Skip to content

Instantly share code, notes, and snippets.

@hmemcpy
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save hmemcpy/9f47ae12d88b4ab38439 to your computer and use it in GitHub Desktop.

Select an option

Save hmemcpy/9f47ae12d88b4ab38439 to your computer and use it in GitHub Desktop.
ATDD style tests with BDDfy!
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