public void Dispose_MultipleCalls_DoesNotThrow() { var subject = new PropertyBinding <int, float>( BindingType.OneWayToSource, _dependencyPropertyMock.Object, _notifyingObjectMock.Object, _converterMock.Object); subject.Dispose(); Assert.DoesNotThrow(() => subject.Dispose()); }
public void Dispose_SourceUpdated_TargetNotUpdated() { _converterMock.Setup(mock => mock.CanConvert(It.IsAny <int>(), It.IsAny <CultureInfo>())); var subject = new PropertyBinding <int, float>( BindingType.OneWayToSource, _dependencyPropertyMock.Object, _notifyingObjectMock.Object, _converterMock.Object); subject.Dispose(); _notifyingObjectMock.Raise(mock => mock.PropertyChanged += null, new PropertyChangedEventArgs <int>(0, 1)); _converterMock.Verify(mock => mock.CanConvert(It.IsAny <int>(), It.IsAny <CultureInfo>()), Times.Never); }
public void Dispose_SourceUpdated_TargetNotUpdated() { _converterMock.Setup(mock => mock.CanConvert(It.IsAny<int>(), It.IsAny<CultureInfo>())); var subject = new PropertyBinding<int, float>( BindingType.OneWayToSource, _dependencyPropertyMock.Object, _notifyingObjectMock.Object, _converterMock.Object); subject.Dispose(); _notifyingObjectMock.Raise(mock => mock.PropertyChanged += null, new PropertyChangedEventArgs<int>(0, 1)); _converterMock.Verify(mock => mock.CanConvert(It.IsAny<int>(), It.IsAny<CultureInfo>()), Times.Never); }
public void Dispose_MultipleCalls_DoesNotThrow() { var subject = new PropertyBinding<int, float>( BindingType.OneWayToSource, _dependencyPropertyMock.Object, _notifyingObjectMock.Object, _converterMock.Object); subject.Dispose(); Assert.DoesNotThrow(() => subject.Dispose()); }