Microsoft.ApplicationInsights.Web.AuthenticatedUserIdTelemetryInitializerTests.InitializeSetsIdForTelemetryUsingIdFromRequestTelemetry C# (CSharp) Method

InitializeSetsIdForTelemetryUsingIdFromRequestTelemetry() private method

        public void InitializeSetsIdForTelemetryUsingIdFromRequestTelemetry()
        {
            // Arrange
            var eventTelemetry = new EventTelemetry("name");
            var source = new TestableAuthenticatedUserIdTelemetryInitializer();
            RequestTelemetry requestTelemetry = source.FakeContext.CreateRequestTelemetryPrivate();
            requestTelemetry.Context.User.AuthenticatedUserId = "1";

            // Act
            source.Initialize(eventTelemetry);

            // Assert
            Assert.AreEqual("1", eventTelemetry.Context.User.AuthenticatedUserId);
        }