public void AnalyticsEventProcessor_FlagIsTrue_SendEvent_IsCalledOnlyOnce() { _mockCustomConfigurationManager.Setup(e => e.GetFlag(It.IsAny <string>())).Returns(true); _customEventProcessor = new AnalyticsEventProcessor(_mockCustomConfigurationManager.Object, _mockAnalyticsEnginesFactory.Object); _customEventProcessor.LogEvent(_dummyAnalyticsEvent); _mockApplicationInsightsAnalyticsEngine.Verify(m => m.SendEvent(_dummyAnalyticsEvent), Times.Exactly(1)); }
public void AnalyticsEventProcessor_FlagIsFalse_SendEvent_DoesNotGetCalled() { _mockCustomConfigurationManager.Setup(e => e.GetFlag(It.IsAny <string>())).Returns(false); _customEventProcessor = new AnalyticsEventProcessor(_mockCustomConfigurationManager.Object, _mockAnalyticsEnginesFactory.Object); _customEventProcessor.LogEvent(_dummyAnalyticsEvent); _mockApplicationInsightsAnalyticsEngine.Verify(m => m.SendEvent(_dummyAnalyticsEvent), Times.Never()); }