예제 #1
0
        public void When_InputA_And_InputB_Changes_Dependent_Notification_Fires()
        {
            var           viewModel         = new Single_Property_Multiple_Dependencies();
            List <string> propertiesChanged = new List <string>();

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

            viewModel.InputA = 5;
            viewModel.InputB = 6;

            Assert.That(propertiesChanged.Count, Is.EqualTo(4));
            Assert.That(propertiesChanged[0], Is.EqualTo("InputA"));
            Assert.That(propertiesChanged[1], Is.EqualTo("APlusB"));
            Assert.That(propertiesChanged[2], Is.EqualTo("InputB"));
            Assert.That(propertiesChanged[3], Is.EqualTo("APlusB"));
        }
        public void When_InputA_And_InputB_Changes_Dependent_Notification_Fires()
        {
            var viewModel = new Single_Property_Multiple_Dependencies();
            List<string> propertiesChanged = new List<string>();
            viewModel.PropertyChanged += (s, e) => propertiesChanged.Add(e.PropertyName);

            viewModel.InputA = 5;
            viewModel.InputB = 6;

            Assert.That(propertiesChanged.Count, Is.EqualTo(4));
            Assert.That(propertiesChanged[0], Is.EqualTo("InputA"));
            Assert.That(propertiesChanged[1], Is.EqualTo("APlusB"));
            Assert.That(propertiesChanged[2], Is.EqualTo("InputB"));
            Assert.That(propertiesChanged[3], Is.EqualTo("APlusB"));
        }