public void can_clear_payload() { var metricsMock = new Mock <IMetrics>(); var clock = new TestClock(); var meter = new DefaultMeterMetric(clock); meter.Mark(new MetricSetItem("item1", "value1"), 1); meter.Mark(new MetricSetItem("item2", "value2"), 1); var meterValueSource = new MeterValueSource( "test meter", ConstantValue.Provider(meter.Value), Unit.None, TimeUnit.Milliseconds, MetricTags.Empty); var payloadBuilder = new LineProtocolPayloadBuilder(); var reporter = CreateReporter(payloadBuilder); reporter.StartReportRun(metricsMock.Object); reporter.ReportMetric("test", meterValueSource); var sr = new StringWriter(); payloadBuilder.Payload().Format(sr); sr.ToString().Should().NotBeNullOrWhiteSpace(); payloadBuilder.Clear(); payloadBuilder.Payload().Should().BeNull(); }