Microsoft.ApplicationInsights.Extensibility.SdkInternalOperationsMonitor.IsEntered()

Here are the examples of the csharp api class Microsoft.ApplicationInsights.Extensibility.SdkInternalOperationsMonitor.IsEntered() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

4 Examples 7

1. Example

Project: ApplicationInsights-dotnet
Source File: InMemoryTransmitterTests.cs
public override IEnumerable<ITelemetry> Dequeue()
                {
                    Assert.IsTrue(SdkInternalOperationsMonitor.IsEntered());
                    HttpClient client = new HttpClient();
                    var task = client.GetStringAsync("http://bing.com").ContinueWith((result) => { Assert.IsTrue(SdkInternalOperationsMonitor.IsEntered()); });

                    task.Wait();

                    WasCalled = true;
                    return base.Dequeue();
                }

2. Example

Project: ApplicationInsights-dotnet
Source File: ServerTelemetryChannelTest.cs
public override Task<HttpWebResponseWrapper> SendAsync()
                {
                    Assert.IsTrue(SdkInternalOperationsMonitor.IsEntered());
                    this.WasCalled(true);
                    return base.SendAsync();
                }

3. Example

Project: ApplicationInsights-dotnet
Source File: ServerTelemetryChannelTest.cs
public override Task<HttpWebResponseWrapper> SendAsync()
                {
                    Assert.IsTrue(SdkInternalOperationsMonitor.IsEntered());
                    this.WasCalled(true);
                    return base.SendAsync();
                }

4. Example

Project: ApplicationInsights-dotnet
Source File: TelemetryConfigurationFactoryTest.cs
[TestMethod]
        public void InitializeIsMarkesAsInternalSdkOperation()
        {
            bool isInternalOperation = false;

            StubConfigurableWithStaticCallback.OnInitialize = (item) => { isInternalOperation = SdkInternalOperationsMonitor.IsEntered(); };

            Assert.AreEqual(false, SdkInternalOperationsMonitor.IsEntered());
            string configFileContents = Configuration(
                @"<TelemetryModules>
                    <Add Type = """ + typeof(StubConfigurableWithStaticCallback).AssemblyQualifiedName + @"""  />
                  </TelemetryModules>"
                );

            var modules = new TestableTelemetryModules();
            new TestableTelemetryConfigurationFactory().Initialize(new TelemetryConfiguration(), modules, configFileContents);

            Assert.AreEqual(true, isInternalOperation);
            Assert.AreEqual(false, SdkInternalOperationsMonitor.IsEntered());
        }