public void Exception_does_not_bubble_up_when_thrown_from_FinishTracerImpl() { var tracer = Mock.Create <ITracer>(Behavior.Strict); Mock.Arrange(() => tracer.Finish(null as object, null as Exception)).Throws(new Exception()); Assert.DoesNotThrow(() => AgentShim.FinishTracer(tracer, null, null)); }
public void returns_null_when_tracer_object_is_null() { // ARRANGE object tracer = null; // ACT AgentShim.FinishTracer(tracer, null, null); // ASSERT Assert.AreEqual(0, _logger.MessageCount, "Expected no log entries but got: " + _logger.ToString()); }
public void returns_without_calling_finish_when_exception_object_is_not_an_exception() { // ARRANGE var tracer = Mock.Create <ITracer>(Behavior.Strict); Mock.Arrange(() => tracer.Finish(Arg.AnyObject, Arg.IsAny <Exception>())).OccursNever(); var exception = new object(); // ACT AgentShim.FinishTracer(tracer, null, exception); // ASSERT Mock.Assert(tracer); }
public void calls_Finish_on_tracer_with_return_passed_through() { // ARRANGE var tracer = Mock.Create <ITracer>(Behavior.Strict); var retrn = new object(); var exception = null as Exception; Mock.Arrange(() => tracer.Finish(retrn, exception)).OccursOnce(); // ACT AgentShim.FinishTracer(tracer, retrn, exception); // ASSERT Mock.Assert(tracer); }
public void does_not_throw_when_tracer_object_is_not_an_ITracer() { object tracer = new object(); Assert.DoesNotThrow(() => AgentShim.FinishTracer(tracer, null, null)); }