public int Length() { if (index.GetValue() > list.Length) { return(list.Length); } return(index.GetValue()); }
public void Test_AtomicInteger() { AtomicInteger value = new AtomicInteger(); Assert.Equal(0, value.GetValue()); var andIncrement = value.GetAndIncrement(); Assert.Equal(0, andIncrement); Assert.Equal(1, value.GetValue()); }
public void can_be_assigned() { _num.SetValue(10); AtomicInteger y = _num; y.GetValue().Should().Be(10); }
public void AtomicInteger_CanBeAssigned() { this.num.SetValue(10); AtomicInteger y = num; y.GetValue().Should().Be(10); }
public void Get() { // ReSharper disable UnusedVariable var x = _num.GetValue(); // ReSharper restore UnusedVariable }
public void Get() { var x = _num.GetValue(); }
public void can_add_value() { _num.Add(7).Should().Be(7); _num.GetValue().Should().Be(7); }
private MemoryStream GetStream(AtomicInteger index, params MemoryStream[] streams) { return(streams[index.GetValue()]); }