enabling ignore tests (#1948)
* enabling ignore tests * disabling 6 .net45 tests to improve code coverage
This commit is contained in:
Родитель
470f3ae84a
Коммит
502ff5681e
|
@ -17,7 +17,6 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
/// Tests for client server dependency tracker.
|
||||
/// </summary>
|
||||
[TestClass]
|
||||
[Ignore("Test class out of date. Github Issue 1830")]
|
||||
public class ClientServerDependencyTrackerTests : IDisposable
|
||||
{
|
||||
private List<ITelemetry> sendItems;
|
||||
|
@ -54,6 +53,7 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
ClientServerDependencyTracker.PretendProfilerIsAttached = false;
|
||||
}
|
||||
|
||||
#if !NET45
|
||||
/// <summary>
|
||||
/// Tests if BeginWebTracking() returns operation with associated telemetry item (with start time and time stamp).
|
||||
/// </summary>
|
||||
|
@ -68,6 +68,7 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
Assert.IsTrue(telemetry.Id.StartsWith('|' + telemetry.Context.Operation.Id, StringComparison.Ordinal));
|
||||
Assert.AreEqual(0, telemetry.Properties.Count);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Tests if BeginWebTracking() returns operation with associated telemetry item (with operation context).
|
||||
|
|
|
@ -21,7 +21,6 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
[Ignore("Test class out of date. Github Issue 1830")]
|
||||
public class DesktopDiagnosticSourceHttpProcessingTests
|
||||
{
|
||||
#region Fields
|
||||
|
@ -207,6 +206,7 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
RequestResponseHeaders.RequestContextCorrelationSourceKey));
|
||||
}
|
||||
|
||||
#if !NET45
|
||||
/// <summary>
|
||||
/// Ensures that the legacy correlation headers are NOT added when request is sent if HttpProcessing is configured to.
|
||||
/// </summary>
|
||||
|
@ -242,6 +242,7 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
Assert.AreEqual(Activity.Current.RootId, actualRootIdHeader);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Ensures that the legacy correlation headers are added when request is sent if HttpProcessing is configured to.
|
||||
|
|
|
@ -19,7 +19,6 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
[Ignore("Test class out of date. Github Issue 1830")]
|
||||
public sealed class FrameworkHttpProcessingTest : IDisposable
|
||||
{
|
||||
#region Fields
|
||||
|
@ -108,6 +107,7 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
null);
|
||||
}
|
||||
|
||||
#if !NET45
|
||||
[TestMethod]
|
||||
public void RddTestHttpProcessingFrameworkOnEndHttpCallbackSuccessParentActivity()
|
||||
{
|
||||
|
@ -133,6 +133,7 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
"200",
|
||||
parentActivity);
|
||||
}
|
||||
#endif
|
||||
|
||||
[TestMethod]
|
||||
public void RddTestHttpProcessingFrameworkOnEndHttpCallbackSuccessParentActivityW3COff()
|
||||
|
@ -371,9 +372,9 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
Assert.AreEqual(expectedTarget, receivedItem.Target, "HttpProcessingFramework returned incorrect target for non standard port.");
|
||||
}
|
||||
|
||||
#endregion //BeginEndCallBacks
|
||||
#endregion //BeginEndCallBacks
|
||||
|
||||
#region AsyncScenarios
|
||||
#region AsyncScenarios
|
||||
|
||||
/// <summary>
|
||||
/// Validates HttpProcessingFramework calculates startTime from the start of very first OnRequestSend if any
|
||||
|
@ -409,17 +410,17 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
null);
|
||||
}
|
||||
|
||||
#endregion AsyncScenarios
|
||||
#endregion AsyncScenarios
|
||||
|
||||
#region Disposable
|
||||
#region Disposable
|
||||
public void Dispose()
|
||||
{
|
||||
this.configuration.Dispose();
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
#endregion Disposable
|
||||
#endregion Disposable
|
||||
|
||||
#region Helpers
|
||||
#region Helpers
|
||||
private static void ValidateTelemetryPacketForOnBeginHttpCallback(
|
||||
DependencyTelemetry remoteDependencyTelemetryActual,
|
||||
Uri url,
|
||||
|
@ -491,7 +492,7 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
}
|
||||
}
|
||||
|
||||
#endregion Helpers
|
||||
#endregion Helpers
|
||||
}
|
||||
}
|
||||
#endif
|
|
@ -19,7 +19,6 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
[Ignore("Test class out of date. Github Issue 1830")]
|
||||
public sealed class FrameworkSqlProcessingTest : IDisposable
|
||||
{
|
||||
private const int TimeAccuracyMilliseconds = 50;
|
||||
|
@ -274,6 +273,7 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
null);
|
||||
}
|
||||
|
||||
#if !NET45
|
||||
/// <summary>
|
||||
/// Validates SQLProcessingFramework sends correct telemetry.
|
||||
/// </summary>
|
||||
|
@ -308,6 +308,8 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
string.Empty,
|
||||
null);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endregion
|
||||
|
||||
#region Disposable
|
||||
|
|
|
@ -23,7 +23,6 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
[Ignore("Test class out of date. Github Issue 1830")]
|
||||
public sealed class ProfilerHttpProcessingTest : IDisposable
|
||||
{
|
||||
#region Fields
|
||||
|
@ -174,6 +173,7 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
RequestResponseHeaders.RequestContextCorrelationSourceKey));
|
||||
}
|
||||
|
||||
#if !NET45
|
||||
/// <summary>
|
||||
/// Ensures that the source request header is added when request is sent.
|
||||
/// </summary>
|
||||
|
@ -209,6 +209,7 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
Assert.AreEqual(actualParentIdHeader, request.Headers[RequestResponseHeaders.RequestIdHeader]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Ensures that the parent id header is added when request is sent.
|
||||
|
@ -322,6 +323,7 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
Assert.IsTrue(actualCorrelationContextHeader == "Key2=Value2,Key1=Value1" || actualCorrelationContextHeader == "Key1=Value1,Key2=Value2");
|
||||
}
|
||||
|
||||
#if !NET45
|
||||
[TestMethod]
|
||||
public void RddTestHttpProcessingProfilerOnBeginOnEnd()
|
||||
{
|
||||
|
@ -361,6 +363,7 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
Assert.IsTrue(dependency.Properties.TryGetValue("k", out var baggageK));
|
||||
Assert.AreEqual("v", baggageK);
|
||||
}
|
||||
#endif
|
||||
|
||||
[TestMethod]
|
||||
public void RddTestHttpProcessingProfilerOnBeginOnEndW3COff()
|
||||
|
@ -563,9 +566,9 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
}
|
||||
}
|
||||
|
||||
#endregion //GetResponse
|
||||
#endregion //GetResponse
|
||||
|
||||
#region GetRequestStream
|
||||
#region GetRequestStream
|
||||
|
||||
/// <summary>
|
||||
/// Validates HttpProcessingProfiler returns correct operation for OnBeginForGetRequestStream.
|
||||
|
@ -606,9 +609,9 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
this.ValidateTelemetryPacket(this.sendItems[0] as DependencyTelemetry, this.testUrl, RemoteDependencyConstants.HTTP, false, stopwatch.Elapsed.TotalMilliseconds, string.Empty, responseExpected: false);
|
||||
}
|
||||
|
||||
#endregion //GetRequestStream
|
||||
#endregion //GetRequestStream
|
||||
|
||||
#region BeginGetResponse-EndGetResponse
|
||||
#region BeginGetResponse-EndGetResponse
|
||||
|
||||
/// <summary>
|
||||
/// Validates HttpProcessingProfiler returns correct operation for OnBeginForBeginGetResponse.
|
||||
|
@ -697,9 +700,9 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
this.ValidateTelemetryPacket(this.sendItems[0] as DependencyTelemetry, this.testUrl, RemoteDependencyConstants.HTTP, false, stopwatch.Elapsed.TotalMilliseconds, string.Empty, responseExpected: false);
|
||||
}
|
||||
|
||||
#endregion //BeginGetResponse-EndGetResponse
|
||||
#endregion //BeginGetResponse-EndGetResponse
|
||||
|
||||
#region BeginGetRequestStream-EndGetRequestStream
|
||||
#region BeginGetRequestStream-EndGetRequestStream
|
||||
|
||||
/// <summary>
|
||||
/// Validates HttpProcessingProfiler returns correct operation for OnBeginForBeginGetRequestStream.
|
||||
|
@ -740,9 +743,9 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
this.ValidateTelemetryPacket(this.sendItems[0] as DependencyTelemetry, this.testUrl, RemoteDependencyConstants.HTTP, false, stopwatch.Elapsed.TotalMilliseconds, string.Empty, responseExpected: false);
|
||||
}
|
||||
|
||||
#endregion //BeginGetRequestStream-EndGetRequestStream
|
||||
#endregion //BeginGetRequestStream-EndGetRequestStream
|
||||
|
||||
#region SyncScenarios
|
||||
#region SyncScenarios
|
||||
|
||||
/// <summary>
|
||||
/// Validates HttpProcessingProfiler calculates startTime from the start of very first GetRequestStream
|
||||
|
@ -804,9 +807,9 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
Assert.AreEqual(1, this.sendItems.Count, "Exactly one telemetry item should be sent");
|
||||
this.ValidateTelemetryPacket(this.sendItems[0] as DependencyTelemetry, this.testUrl, RemoteDependencyConstants.HTTP, false, 0, string.Empty, responseExpected: false);
|
||||
}
|
||||
#endregion //SyncScenarios
|
||||
#endregion //SyncScenarios
|
||||
|
||||
#region AsyncScenarios
|
||||
#region AsyncScenarios
|
||||
|
||||
/// <summary>
|
||||
/// Validates HttpProcessingProfiler calculates startTime from the start of very first BeginGetRequestStream if any
|
||||
|
@ -841,9 +844,9 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
this.ValidateTelemetryPacket(this.sendItems[0] as DependencyTelemetry, this.testUrl, RemoteDependencyConstants.HTTP, true, stopwatch.Elapsed.TotalMilliseconds, "200");
|
||||
}
|
||||
|
||||
#endregion AsyncScenarios
|
||||
#endregion AsyncScenarios
|
||||
|
||||
#region ProfilerCorrectlyPreventsRecursion
|
||||
#region ProfilerCorrectlyPreventsRecursion
|
||||
|
||||
/// <summary>
|
||||
/// Validates HttpProcessingProfiler sends correct telemetry on calling OnEndForGetResponse.
|
||||
|
@ -892,9 +895,9 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Misc
|
||||
#region Misc
|
||||
|
||||
/// <summary>
|
||||
/// Validates HttpProcessingProfiler determines resource name correctly for simple url.
|
||||
|
@ -968,9 +971,9 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
Assert.AreEqual(expectedTarget, receivedItem.Target, "HttpProcessingProfiler returned incorrect target for non standard port.");
|
||||
}
|
||||
|
||||
#endregion //Misc
|
||||
#endregion //Misc
|
||||
|
||||
#region LoggingTests
|
||||
#region LoggingTests
|
||||
|
||||
/// <summary>
|
||||
/// Validates HttpProcessingProfiler logs to event log when resource name is null or empty.
|
||||
|
@ -995,17 +998,17 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
}
|
||||
}
|
||||
|
||||
#endregion //LoggingTests
|
||||
#endregion //LoggingTests
|
||||
|
||||
#region Disposable
|
||||
#region Disposable
|
||||
public void Dispose()
|
||||
{
|
||||
this.configuration.Dispose();
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
#endregion Disposable
|
||||
#endregion Disposable
|
||||
|
||||
#region Helpers
|
||||
#region Helpers
|
||||
|
||||
private void ValidateTelemetryPacket(
|
||||
DependencyTelemetry remoteDependencyTelemetryActual,
|
||||
|
@ -1061,7 +1064,7 @@ namespace Microsoft.ApplicationInsights.Tests
|
|||
{
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0}={1}", RequestResponseHeaders.RequestContextCorrelationTargetKey, appId);
|
||||
}
|
||||
#endregion Helpers
|
||||
#endregion Helpers
|
||||
}
|
||||
}
|
||||
#endif
|
Загрузка…
Ссылка в новой задаче