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(); }
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(); }
public async Task LogCountAsync_NameIsNull_ExpectArgumentNullException() { await _statsd.LogCountAsync(null); }