public async Task Telemetry_events_set_the_user_identifier_based_on_request_properties_over_CurrentPrincipal()
        {
            HttpResponseMessage response = null;

            using (Log.With<Telemetry>(t => t.WithPropertiesBasedOn(response)).Enter(() => { }))
            {
                var customIdentity = new CustomIdentity("BobbyCurrentPrincipal");
                GenericPrincipal threadCurrentPrincipal = new GenericPrincipal(customIdentity, new[] { "CustomUser" });
                Thread.CurrentPrincipal = threadCurrentPrincipal;
                response = new HttpResponseMessage(HttpStatusCode.OK)
                {
                    RequestMessage = new HttpRequestMessage(HttpMethod.Get, @"http://contoso.com/")
                    {
                        Properties = { new KeyValuePair<string, object>("__Its_Log_UserIdentifier", "BobbyRequestProperty") }
                    }
                };
            }

            telemetryEvents.Single()
                           .UserIdentifier
                           .Should()
                           .Be("BobbyRequestProperty");
        }
        public async Task Telemetry_events_set_the_user_identifier_based_on_the_CurrentPrincipal_when_the_property_is_not_set()
        {
            HttpResponseMessage response = null;

            using (Log.With<Telemetry>(t => t.WithPropertiesBasedOn(response)).Enter(() => { }))
            {
                var customIdentity = new CustomIdentity("Bobby");
                GenericPrincipal threadCurrentPrincipal = new GenericPrincipal(customIdentity, new[] { "CustomUser" });
                Thread.CurrentPrincipal = threadCurrentPrincipal;
                response = new HttpResponseMessage(HttpStatusCode.OK)
                {
                    RequestMessage = new HttpRequestMessage(HttpMethod.Get, @"http://contoso.com/")
                };
            }

            telemetryEvents.Single()
                           .UserIdentifier
                           .Should()
                           .Be("Bobby");
        }