示例#1
0
        public void Editable006CanEndEditPrivateField()
        {
            TestEditable vm = new TestEditable();

            vm.SetPrivateField("1");
            vm.BeginEdit();
            vm.SetPrivateField("2");
            vm.EndEdit();
            Assert.Equal("2", vm.GetPrivateField());
        }
示例#2
0
        public void Editable004CanCancelEditPublicObservableProperty()
        {
            TestEditable vm = new TestEditable();

            vm.TestPublicObservableCollectionPropery.Add("1");
            vm.BeginEdit();
            vm.TestPublicObservableCollectionPropery.Add("2");
            vm.CancelEdit();
            Assert.Single(vm.TestPublicObservableCollectionPropery);
            Assert.Equal("1", vm.TestPublicObservableCollectionPropery[0]);
        }
示例#3
0
        public void Editable003CanCancelEditPublicListProperty()
        {
            TestEditable vm = new TestEditable();

            vm.TestPublicListPropery.Add("1");
            vm.BeginEdit();
            vm.TestPublicListPropery.Add("2");
            vm.CancelEdit();
            Assert.Single(vm.TestPublicListPropery);
            Assert.Equal("1", vm.TestPublicListPropery[0]);
        }
示例#4
0
        public void Editable007CanEndEditPublicListProperty()
        {
            TestEditable vm = new TestEditable();

            vm.TestPublicListPropery.Add("1");
            vm.BeginEdit();
            vm.TestPublicListPropery.Add("2");
            vm.EndEdit();
            Assert.Equal(2, vm.TestPublicListPropery.Count);
            Assert.Equal("1", vm.TestPublicListPropery[0]);
            Assert.Equal("2", vm.TestPublicListPropery[1]);
        }
示例#5
0
        public void Editable005CanEndEditPublicProperty()
        {
            TestEditable vm = new TestEditable
            {
                TestPublicPropery = "1"
            };

            vm.BeginEdit();
            vm.TestPublicPropery = "2";
            vm.EndEdit();
            Assert.Equal("2", vm.TestPublicPropery);
        }
示例#6
0
        public void Editable001CanCancelEditPublicProperty()
        {
            TestEditable vm = new TestEditable
            {
                TestPublicPropery = "1"
            };

            vm.BeginEdit();
            vm.TestPublicPropery = "2";
            vm.CancelEdit();
            Assert.Equal("1", vm.TestPublicPropery);
        }
示例#7
0
        public void Editable008CanEndEditPublicObservableProperty()
        {
            TestEditable vm = new TestEditable();

            vm.TestPublicObservableCollectionPropery.Add("1");
            vm.BeginEdit();
            vm.TestPublicObservableCollectionPropery.Add("2");
            vm.EndEdit();
            Assert.Equal(2, vm.TestPublicObservableCollectionPropery.Count);
            Assert.Equal("1", vm.TestPublicObservableCollectionPropery[0]);
            Assert.Equal("2", vm.TestPublicObservableCollectionPropery[1]);
        }