Inheritance: Metric, IAllowsInteger, IAllowsSampleRate
            public void sends_multiple_metrics_at_once()
            {
                var metric1 = new Counting() { Name = "testMetric", ValueAsInt = 5 };
                var metric2 = new Timing() { Name = "testtimer", ValueAsInt = 10 };

                var sender = new BatchSender();
                sender.StatsdUDP = _udp;
                sender.Send(metric1);
                sender.Send(metric2);
                sender.Flush();

                IList<object[]> argsPerCall = _udp.GetArgumentsForCallsMadeOn(x => x.Send(Arg<string>.Is.Anything));
                Assert.That(argsPerCall.Count, Is.EqualTo(1));
                var packet = (string)argsPerCall[0][0];
                var lines = packet.Split('\n');
                Assert.That(lines.Length, Is.EqualTo(2));
                Assert.That(lines[0], Is.EqualTo(metric1.Command));
                Assert.That(lines[1], Is.EqualTo(metric2.Command));
            }
            public void does_not_aggregate_timers()
            {
                var sender = new ThreadSafeConsumerProducerSender(new ThreadSafeConsumerProducerSender.Configuration() { MaxSendDelayMS = 1000 });
                sender.StatsdUDP = _udp;
                var metricsToSend = 10;
                var metric = new Timing() { Name = "testMetric", ValueAsInt = 50 };
                for (var i = 0; i < metricsToSend; i++)
                    sender.Send(metric);

                Thread.Sleep(1500);
                IList<object[]> argsPerCall = _udp.GetArgumentsForCallsMadeOn(x => x.Send(Arg<string>.Is.Anything));

                for (var i = 0; i < argsPerCall.Count; i ++)
                {
                    var packet = (string)argsPerCall[i][0];
                    var lines = packet.Split('\n');
                    for(var j = 0; j < lines.Length; j ++)
                    {
                        Assert.That(lines[j], Is.EqualTo(metric.Command));
                    }
                }
            }
            public void stops_worker_threads_after_dispose()
            {
                var sender = new ThreadSafeConsumerProducerSender(new ThreadSafeConsumerProducerSender.Configuration() { MaxSendDelayMS = 1000 });
                sender.StatsdUDP = _udp;
                var metric = new Timing() { Name = "testMetric", ValueAsInt = 50 };

                sender.Dispose();
                sender.Send(metric);

                Thread.Sleep(1500);
                IList<object[]> argsPerCall = _udp.GetArgumentsForCallsMadeOn(x => x.Send(Arg<string>.Is.Anything));
                Assert.That(argsPerCall.Count, Is.EqualTo(0));
            }
            public void sends_multiple_metrics_individually()
            {
                var metric1 = new Counting() { Name = "testMetric", ValueAsInt = 5 };
                var metric2 = new Timing() { Name = "testtimer", ValueAsInt = 10 };

                var sender = new ImmediateSender();
                sender.StatsdUDP = _udp;
                sender.Send(metric1);
                sender.Send(metric2);

                IList<object[]> argsPerCall = _udp.GetArgumentsForCallsMadeOn(x => x.Send(Arg<string>.Is.Anything));
                Assert.That(argsPerCall.Count, Is.EqualTo(2));
                Assert.That(((string)argsPerCall[0][0]), Is.EqualTo(metric1.Command));
                Assert.That(((string)argsPerCall[1][0]), Is.EqualTo(metric2.Command));
            }