public void TrackAvailabilityTest()
        {
            // 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.TrackAvailability("test", DateTimeOffset.Now, new TimeSpan(1000), "run location", true,
                                     "message", new Dictionary <string, string>()
            {
                { "hello", "value" }
            }, new Dictionary <string, double>()
            {
                { "metric", 0.6 }
            });
        }
Ejemplo n.º 2
0
            public void TrackAvailabilityTest()
            {
                _botTelemetryClient.TrackAvailability("test", DateTimeOffset.Now, new TimeSpan(1000), "run location", true,
                                                      "message", new Dictionary <string, string>()
                {
                    { "hello", "value" }
                }, new Dictionary <string, double>()
                {
                    { "metric", 0.6 }
                });

                _mockTelemetryChannel.Verify(tc => tc.Send(It.Is <AvailabilityTelemetry>(t => t.Name == "test")));
                _mockTelemetryChannel.Verify(tc => tc.Send(It.Is <AvailabilityTelemetry>(t => t.Message == "message")));
                _mockTelemetryChannel.Verify(tc => tc.Send(It.Is <AvailabilityTelemetry>(t => t.Properties["hello"] == "value")));
                _mockTelemetryChannel.Verify(tc => tc.Send(It.Is <AvailabilityTelemetry>(t => t.Metrics["metric"] == 0.6)));
            }