Represents a communication channel for sending telemetry to Application Insights via HTTPS.
상속: ITelemetryChannel
 public void WhenSetToTrueChangesTelemetryBufferCapacityToOneForImmediateTransmission()
 {
     ServiceLocator.AddService<BaseStorageService>(new StorageService());
     var channel = new PersistenceChannel();
     channel.DeveloperMode = true;
     Assert.AreEqual(1, channel.TelemetryBuffer.Capacity);
 }
            public void DeveloperModeIsFalseByDefault()
            {
                ServiceLocator.AddService <BaseStorageService>(new StorageService());
                var channel = new PersistenceChannel();

                Assert.IsFalse(channel.DeveloperMode.Value);
            }
 public void DeveloperModeCanBeModifiedByConfiguration()
 {
     ServiceLocator.AddService<BaseStorageService>(new StorageService());
     var channel = new PersistenceChannel();
     channel.DeveloperMode = true;
     Assert.IsTrue(channel.DeveloperMode.Value);
 }
            public void GetterReturnsTelemetryBufferCapacity()
            {
                ServiceLocator.AddService <BaseStorageService>(new StorageService());
                var channel = new PersistenceChannel();

                channel.TelemetryBuffer.Capacity = 42;
                Assert.AreEqual(42, channel.MaxTelemetryBufferCapacity);
            }
            public void WhenSetToTrueChangesTelemetryBufferCapacityToOneForImmediateTransmission()
            {
                ServiceLocator.AddService <BaseStorageService>(new StorageService());
                var channel = new PersistenceChannel();

                channel.DeveloperMode = true;
                Assert.AreEqual(1, channel.TelemetryBuffer.Capacity);
            }
            public void DeveloperModeCanBeModifiedByConfiguration()
            {
                ServiceLocator.AddService <BaseStorageService>(new StorageService());
                var channel = new PersistenceChannel();

                channel.DeveloperMode = true;
                Assert.IsTrue(channel.DeveloperMode.Value);
            }
            public void EndpointAddressCanBeModifiedByConfiguration()
            {
                ServiceLocator.AddService<BaseStorageService>(new StorageService());
                var channel = new PersistenceChannel();
               
                Uri expectedEndpoint = new Uri("http://abc.com");
                channel.EndpointAddress = expectedEndpoint.AbsoluteUri;

                Assert.AreEqual(expectedEndpoint, new Uri(channel.EndpointAddress));
            }
            public void EndpointAddressCanBeModifiedByConfiguration()
            {
                ServiceLocator.AddService <BaseStorageService>(new StorageService());
                var channel = new PersistenceChannel();

                Uri expectedEndpoint = new Uri("http://abc.com");

                channel.EndpointAddress = expectedEndpoint.AbsoluteUri;

                Assert.AreEqual(expectedEndpoint, new Uri(channel.EndpointAddress));
            }
            public void WhenSetToFalseChangesTelemetryBufferCapacityToOriginalValueForBufferedTransmission()
            {
                ServiceLocator.AddService <BaseStorageService>(new StorageService());
                var channel = new PersistenceChannel();
                int originalTelemetryBufferSize = channel.TelemetryBuffer.Capacity;

                channel.DeveloperMode = true;
                channel.DeveloperMode = false;

                Assert.AreEqual(originalTelemetryBufferSize, channel.TelemetryBuffer.Capacity);
            }
            public void WhenSetToFalseChangesTelemetryBufferCapacityToOriginalValueForBufferedTransmission()
            {
                ServiceLocator.AddService<BaseStorageService>(new StorageService());
                var channel = new PersistenceChannel();
                int originalTelemetryBufferSize = channel.TelemetryBuffer.Capacity;

                channel.DeveloperMode = true;
                channel.DeveloperMode = false;

                Assert.AreEqual(originalTelemetryBufferSize, channel.TelemetryBuffer.Capacity);
            }
            public void PassesTelemetryToMemoryBufferChannel()
            {
                ServiceLocator.AddService <BaseStorageService>(new StorageService());
                var channel = new PersistenceChannel();

                var telemetry = new StubTelemetry();

                channel.Send(telemetry);

                IEnumerable <ITelemetry> actual = channel.TelemetryBuffer.Dequeue();

                Assert.AreEqual(telemetry, actual.First());
            }
            private void Action()
            {
                var channel = new PersistenceChannel();

                channel.Dispose();
            }
 public void SetterChangesTelemetryBufferCapacity()
 {
     ServiceLocator.AddService<BaseStorageService>(new StorageService());
     var channel = new PersistenceChannel();
     channel.MaxTelemetryBufferCapacity = 42;
     Assert.AreEqual(42, channel.TelemetryBuffer.Capacity);
 }
 public void DeveloperModeIsFalseByDefault()
 {
     ServiceLocator.AddService<BaseStorageService>(new StorageService());
     var channel = new PersistenceChannel();
     Assert.IsFalse(channel.DeveloperMode.Value);
 }
 private void Action()
 {
     var channel = new PersistenceChannel();
     channel.Dispose();
 }
            public void PassesTelemetryToMemoryBufferChannel()
            {
                ServiceLocator.AddService<BaseStorageService>(new StorageService());
                var channel = new PersistenceChannel();

                var telemetry = new StubTelemetry();
                channel.Send(telemetry);

                IEnumerable<ITelemetry> actual = channel.TelemetryBuffer.Dequeue();
                Assert.AreEqual(telemetry, actual.First());
            }