public string ToGraphiteMessageList() { var rtn = string.Empty; foreach (var result in this.results) { var graphiteMetric = new GraphiteMetric(result.FullPath, result.Value, result.TimeStamp); rtn = string.Concat(rtn , graphiteMetric.ToGraphiteMessage()); } return rtn; }
public void Should_get_a_graphite_object_passing_in_long() { var timestamp = new DateTime(2012, 11, 10, 9, 8, 7); var path = "path"; long value = 121323; var unixtime = 1352538487; IGraphiteMetric graphiteMetric = new GraphiteMetric(path, value, timestamp); Assert.That(graphiteMetric.Path, Is.EqualTo(path)); Assert.That(graphiteMetric.Value, Is.EqualTo(value.ToString())); Assert.That(graphiteMetric.DotNetTimeStamp, Is.EqualTo(timestamp)); Assert.That(graphiteMetric.UnixTimeStamp, Is.EqualTo(unixtime)); Assert.That(graphiteMetric.ToGraphiteMessage(), Is.EqualTo(string.Format("{0} {1} {2}\n", path, value, unixtime))); }