Decrement() публичный Метод

public Decrement ( ) : string
Результат string
Пример #1
0
        public void DecrementingCounterWithValueIsCorrect()
        {
            // Arrange
            var target = new StatsDMessageFormatter();

            // Act
            string actual = target.Decrement(_value, _statBucket);

            // Assert
            actual.ShouldBe(string.Format(CultureInfo.InvariantCulture, "{0}:-{1}|c", _statBucket, _value));
        }
Пример #2
0
        public void DecrementingCounterIsCorrect()
        {
            // Arrange
            var target = new StatsDMessageFormatter(_culture);

            // Act
            string actual = target.Decrement(_statBucket);

            // Assert
            actual.ShouldBe(string.Format(_culture, "{0}:-{1}|c", _statBucket, 1));
        }
Пример #3
0
        public void ValuesArePrefixed()
        {
            var prefix = "foo";
            var target = new StatsDMessageFormatter(prefix);

            var actualGauge     = target.Gauge(_value, _statBucket);
            var actualDecrement = target.Decrement(_statBucket);
            var actualIncrement = target.Increment(_statBucket);
            var actualTiming    = target.Timing(_value, _statBucket);

            actualGauge.ShouldStartWith($"{prefix}.");
            actualDecrement.ShouldStartWith($"{prefix}.");
            actualIncrement.ShouldStartWith($"{prefix}.");
            actualTiming.ShouldStartWith($"{prefix}.");
        }
Пример #4
0
        public void DecrementingMultipleCountersIsCorrect()
        {
            // Arrange
            var target = new StatsDMessageFormatter();

            // Act
            string actual = target.Decrement(_value, _statBuckets);

            // Assert
            var expected = new StringBuilder();

            foreach (var stat in _statBuckets)
            {
                expected.AppendFormat(CultureInfo.InvariantCulture, "{0}:-{1}|c", stat, _value);
            }

            actual.ShouldBe(expected.ToString());
        }
 public void Decrement(string bucket)
 {
     _transport.Send(_formatter.Decrement(bucket));
 }
Пример #6
0
 public void Decrement(string bucket)
 {
     Send(_formatter.Decrement(bucket));
 }