public void Given_we_have_a_view_model()
        {
            _propertyChanges = new List<string>();

            _viewModel = new ViewModelProvider<ViewModel>().Create();
            _viewModel.PropertyChanged += (o, e) =>
            {
                _lastPropertyToChange = e.PropertyName;
                _propertyChanges.Add(_lastPropertyToChange);
            };
            _lastPropertyToChange = null;
        }
        public void Should_raise_custom_event_for_dependees()        // This test was added because of a bug. If we didn't have a handler for PropertyChanged we were not notifying for Custom Events
        {
            _viewModel = new ViewModelProvider<ViewModel>().Create();
            var eventRaised = false;
            _viewModel.AgeChanged += (o, e) => eventRaised = true;
            _viewModel.Dob = DateTime.Now;

            Assert.IsTrue(eventRaised);
        }
 public void Should_notify_custom_events_event_if_not_subscribed_to_propertychanged()        // This test was added because of a bug. If we didn't have a handler for PropertyChanged we were not notifying for Custom Events
 {
     _viewModel = new ViewModelProvider<ViewModel>().Create();
     Should_raise_custom_event();
 }
 public void Should_inherit_attibutes()
 {
     _viewModel = new ViewModelProvider<ViewModel>().Create();
     Assert.AreEqual(1,
         Attribute.GetCustomAttributes(_viewModel.GetType().GetProperty("PropertyWithCustomAttribute"), typeof(CustomAttribute), true).Length);
 }