public void WriteLine_With_Category_Null_Does_Nothing(
     AppCenterTraceListener sut,
     string category)
 {
     sut.WriteLine(null as object, category);
     AssertDoesNothing(sut);
 }
 public void WriteLine_Exception_Invokes_Crashes_TrackError(
     AppCenterTraceListener sut,
     Exception exception)
 {
     sut.WriteLine(exception);
     Mock.Get(sut.Crashes)
     .Verify(c => c.TrackError(exception, null));
 }
 public void WriteLine_AnalyticsEvent_Invokes_Analytics_TrackEvent(
     AppCenterTraceListener sut,
     AnalyticsEvent analyticsEvent)
 {
     sut.WriteLine(analyticsEvent);
     Mock.Get(sut.Analytics)
     .Verify(c => c.TrackEvent(analyticsEvent.EventName, analyticsEvent.Properties));
 }
 public void Write_With_Category_Exception_Invokes_Crashes_TrackError(
     AppCenterTraceListener sut,
     Exception exception,
     string category)
 {
     sut.Write(exception, category);
     Mock.Get(sut.Crashes)
     .Verify(c => c.TrackError(exception, null));
 }
 public void Write_With_Category_AnalyticsEvent_Invokes_Analytics_TrackEvent(
     AppCenterTraceListener sut,
     AnalyticsEvent analyticsEvent,
     string category)
 {
     sut.Write(analyticsEvent, category);
     Mock.Get(sut.Analytics)
     .Verify(c => c.TrackEvent(analyticsEvent.EventName, analyticsEvent.Properties));
 }
        private static void AssertDoesNothing(AppCenterTraceListener sut)
        {
            Mock.Get(sut.Crashes)
            .Verify(
                c => c.TrackError(
                    It.IsAny <Exception>(),
                    It.IsAny <IDictionary <string, string> >()),
                Times.Never);

            Mock.Get(sut.Analytics)
            .Verify(c => c.TrackEvent(
                        It.IsAny <string>(),
                        It.IsAny <IDictionary <string, string> >()),
                    Times.Never);
        }
 public void WriteLine_Null_Does_Nothing(
     AppCenterTraceListener sut)
 {
     sut.WriteLine(null as object);
     AssertDoesNothing(sut);
 }