Microsoft.ApplicationInsights.AppInsightsStandaloneTests.CreateTestApplication(string)

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

1 Example 7

1. Example

Project: ApplicationInsights-dotnet
Source File: AppInsightsStandaloneTests.cs
private string RunTestApplication(bool withDiagnosticSource, string operationId)
        {
            if (withDiagnosticSource)
            {
                File.Copy("System.Diagnostics.DiagnosticSource.dll", $"{this.tempPath}\\System.Diagnostics.DiagnosticSource.dll");
            }

            var fileName = $"{this.tempPath}\\ActivityTest.exe";

            Assert.IsTrue(CreateTestApplication(fileName));

            Process p = new Process
            {
                StartInfo =
                {
                    UseShellExecute = false,
                    RedirectStandardOutput = true,
                    RedirectStandardError = true,
                    FileName = fileName,
                    Arguments = operationId
                }
            };
            
            p.Start();

            Assert.IsTrue(p.WaitForExit(10000));
            Assert.AreEqual(0, p.ExitCode);

            return p.StandardOutput.ReadToEnd();
        }