public void TestAddAge()
        {
            PersonViewModel viewModel = new PersonViewModel
                                            {
                                                Name = "Cheka",
                                                Age = 20
                                            };
            string changedPropertyName = null;
            viewModel.PropertyChanged += (sender, evtargs) => { changedPropertyName = evtargs.PropertyName; };

            viewModel.AgeAddCommand.Execute(null);

            Assert.AreEqual("Age", changedPropertyName);
            Assert.AreEqual(21, viewModel.Age);
        }
示例#2
0
 public AddAgeCommand(PersonViewModel viewModel)
 {
     m_viewModel = viewModel;
 }
示例#3
0
 public AddAgeCommand(PersonViewModel viewModel)
 {
     m_viewModel = viewModel;
 }