Beispiel #1
0
        public void TestRenamedReflection()
        {
            var instance = AutoNotifyPropertyChanged.CreateInstance <MyModelWithNamedProperty>();
            var prop     = instance.GetType().GetProperty("NotName");

            prop.SetValue(instance, "1", null);
            Assert.Equal("1", instance.Name);
        }
Beispiel #2
0
        public void TestNotifyVirtual()
        {
            var instance = AutoNotifyPropertyChanged.CreateInstance <MyModelWithVirtualProperty>();

            TestNamed(instance);
            instance.Name = "2";
            Assert.Equal("2", instance.GetName());
        }
Beispiel #3
0
 public void TestNotifyRenamedAbstract()
 {
     TestNamed(AutoNotifyPropertyChanged.CreateInstance <MyModelWithNamedProperty>(), "NotName");
 }
Beispiel #4
0
 public void TestNotifyAbstract()
 {
     TestNamed(AutoNotifyPropertyChanged.CreateInstance <MyModelWithAbstractProperty>());
 }
Beispiel #5
0
 public void TestIgnorance()
 {
     //Check for correct compilation
     AutoNotifyPropertyChanged.CreateInstance <Ignorance>();
 }
Beispiel #6
0
 public void TestInvalid()
 {
     Assert.Throws <InvalidProgramException>(() => AutoNotifyPropertyChanged.CreateInstance <MyModelWithInvalidProperty>());
 }