Пример #1
0
        public void Consists_of_a_single_monitor()
        {
            var gauge = new BasicGauge <int>(MonitorConfig.Build("Test"), () => 1);

            gauge.GetAllMonitors().Should().HaveCount(1);
            gauge.GetAllMonitors().Single().Should().BeSameAs(gauge);
        }
Пример #2
0
        public void After_get_and_reset_the_value_is_still_gotten_from_func(int expectedValue)
        {
            var gauge = new BasicGauge <int>(MonitorConfig.Build("Test"), () => expectedValue);

            gauge.GetValueAndReset();

            gauge.GetValueAndReset().Should().Be(expectedValue);
        }
Пример #3
0
        public void Gauge_tag_is_added_to_configuration()
        {
            var gauge = new BasicGauge <int>(MonitorConfig.Build("Test"), () => 0);

            gauge.Config.Tags.Should().Contain(DataSourceType.Gauge);
        }
Пример #4
0
        public void Value_is_gotten_through_passed_in_func_when_using_get_and_reset(int expectedValue)
        {
            var gauge = new BasicGauge <int>(MonitorConfig.Build("Test"), () => expectedValue);

            gauge.GetValueAndReset().Should().Be(expectedValue);
        }
Пример #5
0
        public void Value_is_gotten_through_passed_in_func(int expectedValue)
        {
            var gauge = new BasicGauge <int>(MonitorConfig.Build("Test"), () => expectedValue);

            gauge.GetValue().Should().Be(expectedValue);
        }