Ejemplo n.º 1
0
        public void TrackDependencyTest()
        {
            var telemetryClient = new TelemetryClient();
            var client          = new BotTelemetryClient(telemetryClient);
            var telemetry       = new DependencyTelemetry("my dependency", "my target", "foo", "data");

            client.TrackDependency(telemetry);
        }
        public void TrackDependencyTest()
        {
            // 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.TrackDependency("test", "target", "dependencyname", "data", DateTimeOffset.Now, new TimeSpan(10000), "result", false);
        }
            public void TrackDependencyTest()
            {
                _botTelemetryClient.TrackDependency("test", "target", "dependencyname", "data", DateTimeOffset.Now, new TimeSpan(10000), "result", false);

                _mockTelemetryChannel.Verify(tc => tc.Send(It.Is <DependencyTelemetry>(t => t.Type == "test")));
                _mockTelemetryChannel.Verify(tc => tc.Send(It.Is <DependencyTelemetry>(t => t.Target == "target")));
                _mockTelemetryChannel.Verify(tc => tc.Send(It.Is <DependencyTelemetry>(t => t.Name == "dependencyname")));
                _mockTelemetryChannel.Verify(tc => tc.Send(It.Is <DependencyTelemetry>(t => t.Data == "data")));
                _mockTelemetryChannel.Verify(tc => tc.Send(It.Is <DependencyTelemetry>(t => t.ResultCode == "result")));
                _mockTelemetryChannel.Verify(tc => tc.Send(It.Is <DependencyTelemetry>(t => t.Success == false)));
            }