public void OnNewValue_SingleValue(double expected, double newValue) { var window = new GaugeWindowCalculator(); window.OnNewValue(newValue); Assert.AreEqual(expected, window.GetValue()); }
public void GetValue_Zero() { var window = new GaugeWindowCalculator(); var result = window.GetValue(); Assert.AreEqual(0, result); }
public void OnNextSecond_OneTime() { var window = new GaugeWindowCalculator(); window.OnNewValue(10); window.OnNextSecond(); window.OnNewValue(0); Assert.AreEqual(5.0, window.GetValue()); }
public void OnNewValue_Sequence(double expected, double[] newValues) { var window = new GaugeWindowCalculator(); foreach (var val in newValues) { window.OnNewValue(val); } Assert.AreEqual(expected, window.GetValue()); }
public void OnNextSecond_(double expected, double firstVal, double populateVal, double lastVal, int populateTimes) { var window = new GaugeWindowCalculator(); window.OnNewValue(firstVal); for (var i = 0; i < populateTimes; ++i) { window.OnNextSecond(); window.OnNewValue(populateVal); } window.OnNextSecond(); window.OnNewValue(lastVal); Assert.AreEqual(expected, window.GetValue()); }