public void TestRenamedReflection() { var instance = AutoNotifyPropertyChanged.CreateInstance <MyModelWithNamedProperty>(); var prop = instance.GetType().GetProperty("NotName"); prop.SetValue(instance, "1", null); Assert.Equal("1", instance.Name); }
public void TestNotifyVirtual() { var instance = AutoNotifyPropertyChanged.CreateInstance <MyModelWithVirtualProperty>(); TestNamed(instance); instance.Name = "2"; Assert.Equal("2", instance.GetName()); }
public void TestNotifyRenamedAbstract() { TestNamed(AutoNotifyPropertyChanged.CreateInstance <MyModelWithNamedProperty>(), "NotName"); }
public void TestNotifyAbstract() { TestNamed(AutoNotifyPropertyChanged.CreateInstance <MyModelWithAbstractProperty>()); }
public void TestIgnorance() { //Check for correct compilation AutoNotifyPropertyChanged.CreateInstance <Ignorance>(); }
public void TestInvalid() { Assert.Throws <InvalidProgramException>(() => AutoNotifyPropertyChanged.CreateInstance <MyModelWithInvalidProperty>()); }