Exemple #1
0
        public void Get_and_set_returns_the_original_value(double originalValue)
        {
            var atomicDouble = new AtomicDouble(originalValue);

            var value = atomicDouble.GetAndSet(1000);

            value.Should().Be(originalValue);
        }
Exemple #2
0
        public void Get_and_set_updates_the_value_as_specified(double newValue)
        {
            var atomicDouble = new AtomicDouble();

            atomicDouble.GetAndSet(newValue);

            var value = atomicDouble.Get();

            value.Should().Be(newValue);
        }
 public void Can_get_and_set()
 {
     _num.SetValue(32);
     _num.GetAndSet(64).Should().Be(32);
     _num.GetValue().Should().Be(64);
 }