public void GIVENEmptyActivity_WHENDialogActivityLoggerIsCreated_THENExceptionIsBeingThrown() { // Arrange const IActivityInstrumentation emptyActivityInstrumentation = null; // Act // Assert Assert.Throws <ArgumentNullException>(() => new DialogActivityLogger(emptyActivityInstrumentation)); }
public async void GIVENActivity_WHENLogAsyncIsInvoked_THENTrackActivityIsInvoked( IActivity activity, IActivityInstrumentation activityInstrumentation) { // Arrange var instrumentation = new DialogActivityLogger(activityInstrumentation); // Act await instrumentation.LogAsync(activity).ConfigureAwait(false); // Assert Mock.Get(activityInstrumentation).Verify( ai => ai.TrackActivity(activity), Times.Once); }
public DialogActivityLogger(IActivityInstrumentation activityInstrumentation) { this.activityInstrumentation = activityInstrumentation ?? throw new ArgumentNullException(nameof(activityInstrumentation)); }