Created
June 19, 2010 19:27
-
-
Save deurell/445203 to your computer and use it in GitHub Desktop.
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
// Validate fired event | |
[Test(Description = "Verify that prop changed fires [Mikael Deurell]")] | |
public void Description_Changed_FiresPropertyChanged() | |
{ | |
// Given the user wants to change the product description on a Product | |
int notify = 0; | |
var sut = new ProductViewModel(); | |
sut.PropertyChanged += (sender, e) => | |
{ | |
if (e.PropertyName.Equals("Description")) | |
{ | |
++notify; | |
} | |
}; | |
// When changing the Description displayed in a text field on the view bound to the View Model | |
sut.Description = "new description"; | |
// Then PropertyChangeEvent is fired in the View Model in order to let WPF notify the View of the change | |
Assert.That(notify, Is.EqualTo(1)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment