public void Add_WhenResourceGoesOverCap_ShouldLimitBasedOnCap(int limit, int valueToAdd, int expected) { var lazyValue = new LazyValue(0); lazyValue.Limit = limit; lazyValue.Add(valueToAdd); lazyValue.Value.Should().Be(expected); }
public void TestAdd() { var resource = new LazyValue(0, begin, 100, 0); SystemClock.SetClock(begin.AddMinutes(30)); resource.Add(25); Assert.Equal(resource.Value, 75); }