public void When_Value_Is_Set_By_String_It_Can_Be_Retrieved()
        {
            var viewModel = new GetterSetter_By_String();

            viewModel.Foo = "Bar";

            Assert.That(viewModel.Foo, Is.EqualTo("Bar"));
        }
        public void Int_Values_Can_Be_Gotten_And_Set()
        {
            var viewModel = new GetterSetter_By_String();

            viewModel.MyInt = 55;

            Assert.That(viewModel.MyInt, Is.EqualTo(55));
        }
示例#3
0
        public void Int_Values_Can_Be_Gotten_And_Set()
        {
            var viewModel = new GetterSetter_By_String();

            viewModel.MyInt = 55;

            Assert.That(viewModel.MyInt, Is.EqualTo(55));
        }
示例#4
0
        public void When_Value_Is_Set_By_String_It_Can_Be_Retrieved()
        {
            var viewModel = new GetterSetter_By_String();

            viewModel.Foo = "Bar";

            Assert.That(viewModel.Foo, Is.EqualTo("Bar"));
        }
示例#5
0
        public void Setting_With_A_Default_Getter_Retrieves_Set_Value()
        {
            var viewModel = new GetterSetter_By_String();

            viewModel.IntWithDefault = 99;

            Assert.That(viewModel.IntWithDefault, Is.EqualTo(99));
        }
示例#6
0
        public void Dynamic_Values_On_Setter()
        {
            var viewModel = new GetterSetter_By_String();

            (viewModel as dynamic).MyDynamicProperty = "Me";

            Assert.That((viewModel as dynamic).MyDynamicProperty, Is.EqualTo("Me"));
        }
        public void Setting_Twice_Does_Not_Fail()
        {
            var viewModel = new GetterSetter_By_String();

            viewModel.Foo = "Bar";
            viewModel.Foo = "Baz";

            Assert.That(viewModel.Foo, Is.EqualTo("Baz"));
        }
示例#8
0
        public void Setting_Twice_Does_Not_Fail()
        {
            var viewModel = new GetterSetter_By_String();

            viewModel.Foo = "Bar";
            viewModel.Foo = "Baz";

            Assert.That(viewModel.Foo, Is.EqualTo("Baz"));
        }
        public void Setting_Value_Sends_PropertyChanged_Event()
        {
            var viewModel = new GetterSetter_By_String();
            string changedProperties = string.Empty;
            viewModel.PropertyChanged += (s, e) => changedProperties += e.PropertyName;

            viewModel.Foo = "Bar";

            Assert.That(changedProperties, Is.EqualTo("Foo"));
        }
        public void Setting_To_Same_Value_Does_Not_Fire_PropertyChanged_Twice()
        {
            var viewModel = new GetterSetter_By_String();
            string changedProperties = string.Empty;
            viewModel.PropertyChanged += (s, e) => changedProperties += e.PropertyName;

            viewModel.Foo = "Bar";
            viewModel.Foo = "Bar";

            Assert.That(changedProperties, Is.EqualTo("Foo"));
        }
示例#11
0
        public void Setting_Value_Sends_PropertyChanged_Event()
        {
            var    viewModel         = new GetterSetter_By_String();
            string changedProperties = string.Empty;

            viewModel.PropertyChanged += (s, e) => changedProperties += e.PropertyName;

            viewModel.Foo = "Bar";

            Assert.That(changedProperties, Is.EqualTo("Foo"));
        }
示例#12
0
        public void Setting_To_Same_Value_Does_Not_Fire_PropertyChanged_Twice()
        {
            var    viewModel         = new GetterSetter_By_String();
            string changedProperties = string.Empty;

            viewModel.PropertyChanged += (s, e) => changedProperties += e.PropertyName;

            viewModel.Foo = "Bar";
            viewModel.Foo = "Bar";

            Assert.That(changedProperties, Is.EqualTo("Foo"));
        }
        public void Setting_With_A_Default_Getter_Retrieves_Set_Value()
        {
            var viewModel = new GetterSetter_By_String();

            viewModel.IntWithDefault = 99;

            Assert.That(viewModel.IntWithDefault, Is.EqualTo(99));
        }
        public void Dynamic_Values_On_Setter()
        {
            var viewModel = new GetterSetter_By_String();

            (viewModel as dynamic).MyDynamicProperty = "Me";

            Assert.That((viewModel as dynamic).MyDynamicProperty, Is.EqualTo("Me"));
        }
        public void Default_Values_On_Getter()
        {
            var viewModel = new GetterSetter_By_String();

            Assert.That(viewModel.IntWithDefault, Is.EqualTo(56));
        }
示例#16
0
        public void Default_Values_On_Getter()
        {
            var viewModel = new GetterSetter_By_String();

            Assert.That(viewModel.IntWithDefault, Is.EqualTo(56));
        }