public void PropertyChanged_AfterDisposal_DoesNotInvokeCallback() { var vm = new TestViewModel(); var invoked = false; using (PropertyChangedSubscription.Create(vm, null, () => { invoked = true; })) { } vm.Bob = "test"; Assert.False(invoked); }
public void PropertyChanged_ForSpecificProperty_WithActionCallback_WhenOtherChanges_DoesNotInvokeCallback() { var vm = new TestViewModel(); var invoked = false; using (PropertyChangedSubscription.Create(vm, "Bob", () => { invoked = true; })) { vm.Mary = "test"; } Assert.False(invoked); }
public void PropertyChanged_ForAllProperties_WithHandlerCallback_WhenOneChanges_InvokesCallback() { var vm = new TestViewModel(); var invoked = false; using (PropertyChangedSubscription.Create(vm, null, (sender, e) => { invoked = sender == vm && e.PropertyName == "Bob"; })) { vm.Bob = "test"; } Assert.True(invoked); }
public void PropertyChanged_ForSpecificProperty_WithActionCallback_WhenMatchingChanges_InvokesCallback() { var vm = new TestViewModel(); var invoked = false; using (PropertyChangedSubscription.Create(vm, "Bob", () => { invoked = true; })) { vm.Bob = "test"; } Assert.True(invoked); }
public void PropertyChanged_ForAllProperties_WithActionCallback_WhenOneChanges_InvokesCallback() { var vm = new TestViewModel(); var invoked = false; using (PropertyChangedSubscription.Create(vm, null, () => { invoked = true; })) { vm.Bob = "test"; } Assert.True(invoked); }