public void SetPropertyValueTest_EqualReference() { var vm = new ViewModelMock().RegisterCounter(); var obj = new object(); vm.SetPropertyValue(ref obj, obj, "PropertyName"); Assert.AreEqual(0, vm.PropertyChangedRaisedCount); }
public void SetPropertyValueTest_Equal() { var vm = new ViewModelMock().RegisterCounter(); string oldValue = "String"; vm.SetPropertyValue(ref oldValue, "String", "PropertyName"); Assert.AreEqual(0, vm.PropertyChangedRaisedCount); }
public void SetPropertyValueTest_ClearNull() { var vm = new ViewModelMock().RegisterCounter(); object?oldValue = null; vm.SetPropertyValue(ref oldValue, new object(), "PropertyName"); Assert.AreEqual(1, vm.PropertyChangedRaisedCount); }
public void SetPropertyValueTest() { var vm = new ViewModelMock().RegisterCounter(); int value = 13; vm.SetPropertyValue(ref value, 0, "Test"); Assert.AreEqual(1, vm.PropertyChangedRaisedCount); Assert.AreEqual(0, value); }