Exemplo n.º 1
0
        public void OnPropertyChanged_RaisesEventWithMultipleParameters()
        {
            var sut = new TestDisposableClass();
            sut.ShouldNotifyOn(m => m.ResourcesChanged).When(m => m.RaiseWithMultipleParameters = true);

            sut = new TestDisposableClass();
            sut.ShouldNotifyOn(m => m.RaiseWithMultipleParameters).When(m => m.RaiseWithMultipleParameters = true);
        }
Exemplo n.º 2
0
 public void SetNotifyingProperty_CanSetNewValueAndNotify()
 {
     var sut = new TestDisposableClass();
     IDisposable expected = null;
     sut.PropertyChanged += (sender, e) =>
     {
         var args = e as ExtendedPropertyChangedEventArgs<IDisposable>;
         Assert.IsNotNull(args);
     };
     sut.ShouldNotifyOn(m => m.ManagedResource).When(m => m.ManagedResource = expected);
     Assert.AreEqual(expected, sut.ManagedResource, "Property did not change.");
 }
Exemplo n.º 3
0
 public void OnPropertyChanged_RaisesEventWithParameterName()
 {
     var sut = new TestDisposableClass();
     Assert.IsFalse(sut.RaiseWithParameterName);
     sut.ShouldNotifyOn(m => m.ResourcesChanged).When(m => m.RaiseWithParameterName = true);
 }
Exemplo n.º 4
0
 public void SetNotifyingProperty_NotifiesWhenGivenANewValue()
 {
     var sut = new TestDisposableClass();
     sut.PropertyChanged += (x, y) => Test_Parameters(x, y, sut.SetNotifyingPropertyTester);
     sut.ShouldNotifyOn(m => m.SetNotifyingPropertyTester).When(m => m.SetNotifyingPropertyTester = true);
 }