public void Consists_of_a_single_monitor() { var gauge = new DoubleGauge(MonitorConfig.Build("Test")); gauge.GetAllMonitors().Should().HaveCount(1); gauge.GetAllMonitors().Single().Should().BeSameAs(gauge); }
public void Updating_the_value_updates_the_value_correctly(double expectedValue) { var gauge = new DoubleGauge(MonitorConfig.Build("Test")); gauge.Set(expectedValue); gauge.GetValue().Should().Be(expectedValue); }
public void Get_and_reset_gets_the_maximum_value() { const long expected = 100L; var gauge = new DoubleGauge(MonitorConfig.Build("Test")); gauge.Set(expected); gauge.GetValueAndReset().Should().Be(expected); }
public void Get_and_reset_sets_the_value_to_zero() { var gauge = new DoubleGauge(MonitorConfig.Build("Test")); gauge.Set(100L); gauge.GetValueAndReset(); gauge.GetValue().Should().Be(0L); }
public void Reset_sets_the_value_to_zero() { var gauge = new DoubleGauge(MonitorConfig.Build("Test")); gauge.Set(100.0); gauge.Reset(); gauge.GetValues().First().Value.Should().Be(0.0); }
public void Gauge_tag_is_added_to_configuration() { var gauge = new DoubleGauge(MonitorConfig.Build("Test")); gauge.Config.Tags.Should().Contain(DataSourceType.Gauge); }
public void Initial_value_is_zero() { var gauge = new DoubleGauge(MonitorConfig.Build("Test")); gauge.GetValue().Should().Be(0); }
public void Value_is_called_value() { var gauge = new DoubleGauge(MonitorConfig.Build("Test")); gauge.GetValues().Single().Name.Should().Be("value"); }