public void FindClientActionToInvoke_Should_return_Correct_Client_Method(MetricType metricType) { var metric = new Metric() { Name = "default_aspx", Value = 12334234, Time = DateTime.Now, Type = metricType }; _clientFactory.Expect(x => x.FindClient<IMetricClient>()).Return(_metricClient); var method = _service.FindClientActionToInvoke<IMetricClient>(metric); method.Invoke(metric.Name, metric.Value, metric.Time); switch (metricType) { case MetricType.Count: _metricClient.AssertWasCalled(x => x.LogCount(metric.Name, metric.Value, metric.Time)); break; case MetricType.Timing: _metricClient.AssertWasCalled(x => x.LogTiming(metric.Name, metric.Value, metric.Time)); break; case MetricType.Gauge: _metricClient.AssertWasCalled(x => x.LogGauge(metric.Name, metric.Value, metric.Time)); break; case MetricType.Set: _metricClient.AssertWasCalled(x => x.LogSet(metric.Name, metric.Value, metric.Time)); break; } }
public void WriteToDb(Metric metric) { throw new NotImplementedException(); }