Created
December 6, 2012 21:00
-
-
Save bsommardahl/4228338 to your computer and use it in GitHub Desktop.
This file contains 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 Car | |
{ | |
public string Color { get; set; } | |
public string Model { get; set; } | |
public string Make { get; set; } | |
public string Year { get; set; } | |
} | |
public class given_an_object_property_changer_context | |
{ | |
[Test] | |
public void it_should_change_the_object_properties_as_expected() | |
{ | |
var myCar = new Car | |
{ | |
Color = "Blue", | |
Make = "Chevy", | |
Model = "Cruze", | |
Year = "2011", | |
}; | |
myCar.Change() | |
.With(x => x.Color = "Red") | |
.And(x => x.Year = "2012"); | |
ExpectThatTheChangesWereMade(myCar); | |
} | |
void ExpectThatTheChangesWereMade(Car myCar) | |
{ | |
Assert.AreEqual(myCar.Color, "Red"); | |
Assert.AreEqual(myCar.Year, "2012"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment