public void ShouldInstantiateAViewModelWithoutNotification()
        {
            bool notified = false;

            var viewModel = new NaiveViewModel();
            viewModel.PropertyChanged += (s, e) => notified = true;

            Assert.That(notified, Is.False);
            Assert.That(viewModel.Label, Is.EqualTo(""));
        }
Beispiel #2
0
        public void ShouldInstantiateAViewModelWithoutNotification()
        {
            bool notified = false;

            var viewModel = new NaiveViewModel();

            viewModel.PropertyChanged += (s, e) => notified = true;

            Assert.That(notified, Is.False);
            Assert.That(viewModel.Label, Is.EqualTo(""));
        }
        public void ShouldNotifyMeAboutTheChangeOfValue()
        {
            // Arrange
            bool notified = false;

            // System under Test
            var viewModel = new NaiveViewModel();
            viewModel.PropertyChanged += (s, e) => notified = true;

            // Act
            viewModel.Label = "Sulaco";

            // Assert
            Assert.That(notified, Is.True);
            Assert.That(viewModel.Label, Is.EqualTo("Sulaco"));
        }
Beispiel #4
0
        public void ShouldNotifyMeAboutTheChangeOfValue()
        {
            // Arrange
            bool notified = false;

            // System under Test
            var viewModel = new NaiveViewModel();

            viewModel.PropertyChanged += (s, e) => notified = true;

            // Act
            viewModel.Label = "Sulaco";

            // Assert
            Assert.That(notified, Is.True);
            Assert.That(viewModel.Label, Is.EqualTo("Sulaco"));
        }