public void ExchangeInt() { var property = new StoredProperty <int>(7); property.PropertyChanged += delegate { changeEventsFired++; }; property.Exchange(8).Should().Be(7); property.Value.Should().Be(8); changeEventsFired.Should().Be(1); }
public void ExchangeDouble() { var property = new StoredProperty <double>(7); property.PropertyChanged += delegate { changeEventsFired++; }; property.Exchange(8, 0.0001).Should().Be(7); property.Value.Should().Be(8); changeEventsFired.Should().Be(1); }
public void ExchangeGeneric() { var initialValue = new List <int>(); var newValue = new List <int>(); var property = new StoredProperty <List <int> >(initialValue); property.PropertyChanged += delegate { changeEventsFired++; }; property.Exchange(newValue).Should().BeSameAs(initialValue); property.Value.Should().BeSameAs(newValue); changeEventsFired.Should().Be(1); }