Exemple #1
0
        public void WriteEntry(string source, string message, IEventType eventType)
        {
            ITelemetryStrategy telemetryStrategy = _telemetryFactory.Strategy(eventType);

            telemetryStrategy.TrackEvent(source, new Dictionary <string, string>
            {
                { "message", message }
            });
        }
        public void ShouldWriteExceptionWithoutThrowingException()
        {
            TelemetryFactory telemetryFactory = new TelemetryFactory();

            ITelemetryStrategy telemetryStrategy = telemetryFactory.Strategy(new EventType(new EventTypes().Error()));

            Action action = () =>
            {
                telemetryStrategy.TrackEvent("source", new Dictionary <string, string>
                {
                    { "key", "value" }
                });
            };

            action.ShouldNotThrow();
        }