public void AtomicLongCanBeAssigned() { AtomicLong x = new AtomicLong(10L); AtomicLong y = x; y.Value.Should().Be(10L); }
public UniformReservoir(int size) { this.values = new AtomicLong[size]; for (int i = 0; i < values.Length; i++) { values[i] = new AtomicLong(); } }
public void AtomicLongCanBeIncrementedMultipleTimes() { AtomicLong l = new AtomicLong(); l.Increment(); l.Increment(); l.Increment(); l.Value.Should().Be(3L); }
public void AtomicLongCanGetAndSet() { var num = new AtomicLong(); num.SetValue(32); long val = num.GetAndSet(64); val.Should().Be(32); num.Value.Should().Be(64); }
public ExponentiallyDecayingReservoir(int size, double alpha, Clock clock, Scheduler scheduler) { this.size = size; this.alpha = alpha; this.clock = clock; this.rescaleScheduler = scheduler; this.rescaleScheduler.Start(RescaleInterval, () => Rescale()); this.startTime = new AtomicLong(clock.Seconds); }
public void AtomicLongCanBeDecremented() { AtomicLong l = new AtomicLong(10L); l.Decrement(); l.Value.Should().Be(9L); }
public void AtomicLongCanAddValue() { AtomicLong l = new AtomicLong(); l.Add(7L); l.Value.Should().Be(7L); }
public void AtomicLongCanBeIncremented() { AtomicLong l = new AtomicLong(); l.Increment(); l.Value.Should().Be(1L); }
public void AtomicLongCanSetAndReadValue() { var num = new AtomicLong(); num.SetValue(32); num.Value.Should().Be(32); }
public void AtomicLong_CanBeDecremented() { num = new AtomicLong(10L); num.Decrement(); num.Value.Should().Be(9L); }