Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
        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);
        }
Пример #6
0
        public void Gauge_tag_is_added_to_configuration()
        {
            var gauge = new DoubleGauge(MonitorConfig.Build("Test"));

            gauge.Config.Tags.Should().Contain(DataSourceType.Gauge);
        }
Пример #7
0
        public void Initial_value_is_zero()
        {
            var gauge = new DoubleGauge(MonitorConfig.Build("Test"));

            gauge.GetValue().Should().Be(0);
        }
Пример #8
0
        public void Value_is_called_value()
        {
            var gauge = new DoubleGauge(MonitorConfig.Build("Test"));

            gauge.GetValues().Single().Name.Should().Be("value");
        }