Created
November 13, 2012 12:58
-
-
Save laurentkempe/4065637 to your computer and use it in GitHub Desktop.
Fluent interface to test INotifyPropertyChanged sample usage
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
[Test] | |
public void BusinessUnit_SetToAValue_ExpectedPropertyChangedFired() | |
{ | |
//Arrange | |
//Act | |
//Assert | |
_viewModel.Should() | |
.FirePropertyChangedOn(s => s.BusinessUnit) | |
.When(s => s.BusinessUnit = "Test2"); | |
_viewModel.Should() | |
.FirePropertyChangedOn(s => s.BusinessUnit) | |
.HaveValueSetTo(s => s.BusinessUnit, "Test") | |
.When(s => s.BusinessUnit = "Test"); | |
_viewModel.Should() | |
.HaveValueSetTo(s => s.BusinessUnit, "Test2") | |
.When(s => s.BusinessUnit = "Test2"); | |
_viewModel.Should() | |
.FirePropertyChangedOn(vm => vm.BusinessUnit) | |
.SendMessage<ModelChangedMessage>() | |
.HaveValueSetTo(vm => vm.BusinessUnit, "Test") | |
.When(vm => vm.BusinessUnit = "Test"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment