public void TestSizeForIncompleteSuggestion(uint suggestionSessionId, SuggestionDisplayMode mode, int index, string acceptedSuggestion)
        {
            // The text in the telemetry data is like
            // { "Displayed":[2,0],Accepted":"Get-AzSubscription","SuggestionSessionId":"243" }

            var suggestionSession = new SuggestionSession()
            {
                SuggestionSessionId             = suggestionSessionId,
                DisplayMode                     = mode,
                DisplayedSuggestionCountOrIndex = index,
                AcceptedSuggestion              = acceptedSuggestion,
                IsSuggestionComplete            = false,
            };

            var expectedSize = GetSuggestionTelemetryData.PropertyNameSuggestionSessionId.Length + SuggestionSessionTests._AdditionalSizeForKey
                               + suggestionSessionId.ToString(CultureInfo.InvariantCulture).Length
                               + SuggestionDisplayedTelemetryData.PropertyNameDisplayed.Length + SuggestionSessionTests._AdditionalSizeForKey
                               + 2 // For the two digits 1 and 7
                               + SuggestionSessionTests._AdditionalSizeForTwoElementArray
                               + SuggestionAcceptedTelemetryData.PropertyNameAccepted.Length + SuggestionSessionTests._AdditionalSizeForKey
                               + acceptedSuggestion.Length + SuggestionSessionTests._AdditionalSizeForString;

            Assert.Equal(expectedSize, suggestionSession.EstimateTelemetrySize);
        }
        public void TestSizeForDisplaySuggestion(string suggestion, SuggestionSource source, bool isCancelled, string userInput, SuggestionDisplayMode mode, int index)
        {
            // The text in the telemetry data is like
            // { "Found":[["Get-AzSubscription",3]],"IsCanclled":"False","UserInput":"ge","Displayed":[1,7] }
            var commandLineSuggestion = new CommandLineSuggestion();

            commandLineSuggestion.AddSuggestion(new PredictiveSuggestion(suggestion, null), suggestion, source);

            var suggestionSession = new SuggestionSession()
            {
                FoundSuggestion         = commandLineSuggestion,
                IsCancellationRequested = isCancelled,
                UserInput   = userInput,
                DisplayMode = mode,
                DisplayedSuggestionCountOrIndex = index,
                IsSuggestionComplete            = true,
            };

            var expectedSize = GetSuggestionTelemetryData.PropertyNameFound.Length + SuggestionSessionTests._AdditionalSizeForKey
                               + suggestion.Length + SuggestionSessionTests._AdditionalSizeForString
                               + 1                                                        // For the one digit of source
                               + SuggestionSessionTests._AdditionalSizeForTwoElementArray // for [,]
                               + SuggestionSessionTests._AdditionalSizeForArrayBracket    // for [] in Found
                               + GetSuggestionTelemetryData.PropertyNameUserInput.Length + SuggestionSessionTests._AdditionalSizeForKey
                               + userInput.Length + SuggestionSessionTests._AdditionalSizeForString
                               + GetSuggestionTelemetryData.PropertyNameIsCancelled.Length + SuggestionSessionTests._AdditionalSizeForKey
                               + isCancelled.ToString(CultureInfo.InvariantCulture).Length
                               + SuggestionDisplayedTelemetryData.PropertyNameDisplayed.Length + SuggestionSessionTests._AdditionalSizeForKey
                               + 2 // for the two digit 5 and 7.
                               + SuggestionSessionTests._AdditionalSizeForTwoElementArray;

            Assert.Equal(expectedSize, suggestionSession.EstimateTelemetrySize);
        }