示例#1
0
        public async Task LogCountAsync_EmptyStringPrefix_DoesNotStartNameWithPeriod()
        {
            var statsd    = new Statsd("localhost", 12000, prefix: "", outputChannel: _outputChannel.Object);
            var inputStat = "some.stat:1|c";

            _outputChannel.Setup(p => p.SendAsync(It.Is <string>(q => q == inputStat))).Returns(Task.FromResult(false)).Verifiable();
            await statsd.LogCountAsync("some.stat");

            _outputChannel.VerifyAll();
        }
示例#2
0
        public async Task Constructor_PrefixEndsInPeriodAsync_RemovePeriod()
        {
            var statsd = new Statsd("localhost", 12000, "foo.", outputChannel: _outputChannel.Object);
            var stat   = _testData.NextStatName;
            var count  = _testData.NextInteger;

            _outputChannel.Setup(p => p.SendAsync("foo." + stat + ":" + count.ToString() + "|c")).Returns(Task.FromResult(false)).Verifiable();

            await statsd.LogCountAsync(stat, count);

            _outputChannel.VerifyAll();
        }
示例#3
0
 public async Task LogCountAsync_NameIsNull_ExpectArgumentNullException()
 {
     await _statsd.LogCountAsync(null);
 }