Ejemplo n.º 1
0
        public void TrackEventTest()
        {
            var telemetryClient = new TelemetryClient();
            var client          = new BotTelemetryClient(telemetryClient);
            var eventTelemetry  = new EventTelemetry();

            client.TrackEvent(eventTelemetry);
        }
            public void TrackEventTest()
            {
                _botTelemetryClient.TrackEvent("test", new Dictionary <string, string>()
                {
                    { "hello", "value" }
                }, new Dictionary <string, double>()
                {
                    { "metric", 0.6 }
                });

                _mockTelemetryChannel.Verify(tc => tc.Send(It.Is <EventTelemetry>(t => t.Name == "test")));
                _mockTelemetryChannel.Verify(tc => tc.Send(It.Is <EventTelemetry>(t => t.Properties["hello"] == "value")));
                _mockTelemetryChannel.Verify(tc => tc.Send(It.Is <EventTelemetry>(t => t.Metrics["metric"] == 0.6)));
            }
        public void TrackEventTest()
        {
            // Just invoke underlying TelemetryClient.  Not configured, just tests if it can be invoked.
            // Class is sealed, so nothing to mock here.
            var telemetryClient = new TelemetryClient();
            var client          = new BotTelemetryClient(telemetryClient);

            client.TrackEvent("test", new Dictionary <string, string>()
            {
                { "hello", "value" }
            }, new Dictionary <string, double>()
            {
                { "metric", 0.6 }
            });
        }