Inheritance: MethodSpy
		public void adds_prefix_to_metrics() {
			var baseClient = new MyStatsClient();
			var scoped = new ScopedStatsClient(baseClient, "MyStats.");

			var send = new ActionSpy<Metric>(m => Check.That(() => m.Name.StartsWith("MyStats.")));
			baseClient.HandleSend = send;

			scoped.Send(new Metric("MyMetric", MetricValue.Gauge(1)));
			Check.That(() => send.HasBeenCalled);
		}
Example #2
0
        public void unwraps_exception()
        {
            var spy = new ActionSpy(() => { throw new InvalidOperationException();});

            Check.Exception<InvalidOperationException>(() => ((Action)spy)());
        }