@@ -623,7 +623,13 @@ public async Task VerifyOnCommandLineAcceptedException()
623
623
[ InlineData ( "start_of_snippet" , @"-StorageAccountKey""xxx""New-AzStorageContainer -context xxx" ) ]
624
624
[ InlineData ( "start_of_snippet" , @"New-AzureStorageContext-StorageAccountName ""xxx"" -StorageAccountKey ""xxx""" ) ]
625
625
[ InlineData ( "start_of_snippet" , @"sig=xxxxxxxxxxx/Sensor-Azure" ) ]
626
+ [ InlineData ( "start_of_snippet" , @"sig=xxxxxxxxxxx/Get-az" ) ]
626
627
[ InlineData ( "start_of_snippet" , @"sig=Signature/Test-Sensor-Azu" ) ]
628
+ [ InlineData ( "start_of_snippet" , @"sig=Signature/Set-azstorage" ) ]
629
+ [ InlineData ( "start_of_snippet" , "New-AzStorage\" key=value\" " ) ]
630
+ [ InlineData ( "start_of_snippet" , "New-az\\ \" key=value\\ \" " ) ]
631
+ [ InlineData ( "start_of_snippet" , "git" ) ]
632
+ [ InlineData ( "start_of_snippet" , "Get-Key -Key abcd" ) ]
627
633
public void VerifyUserInputInGetSuggestionEvent ( string expectedUserInput , string input )
628
634
{
629
635
var expectedTelemetryCount = 1 ;
@@ -637,8 +643,8 @@ public void VerifyUserInputInGetSuggestionEvent(string expectedUserInput, string
637
643
638
644
Assert . EndsWith ( "Aggregation" , telemetryClient . RecordedTelemetry [ 0 ] . EventName ) ;
639
645
var suggestionSessions = JsonSerializer . Deserialize < IList < IDictionary < string , object > > > ( telemetryClient . RecordedTelemetry [ 0 ] . Properties [ GetSuggestionTelemetryData . PropertyNamePrediction ] ) ;
640
- Assert . Equal ( expectedUserInput , ( ( JsonElement ) ( suggestionSessions [ 0 ] [ GetSuggestionTelemetryData . PropertyNameUserInput ] ) ) . GetString ( ) ) ;
641
- Assert . Equal ( expectedUserInput , telemetryClient . RecordedTelemetry [ 0 ] . Properties [ GetSuggestionTelemetryData . PropertyNameUserInput ] ) ;
646
+ Assert . Equal ( expectedUserInput , ( ( JsonElement ) ( suggestionSessions [ 0 ] [ GetSuggestionTelemetryData . PropertyNameInnerUserInput ] ) ) . GetString ( ) ) ;
647
+ Assert . Equal ( expectedUserInput , telemetryClient . RecordedTelemetry [ 0 ] . Properties [ GetSuggestionTelemetryData . PropertyNameOuterUserInput ] ) ;
642
648
}
643
649
644
650
/// <summary>
@@ -678,7 +684,7 @@ public void VerifySeparateUserInput()
678
684
VerifyTelemetryDispatchCount ( expectedTelemetryCount , telemetryClient ) ;
679
685
680
686
Assert . EndsWith ( "Aggregation" , telemetryClient . RecordedTelemetry [ 0 ] . EventName ) ;
681
- Assert . Equal ( string . Join ( AzPredictorTelemetryClient . _StringValueConcatenator , expectedUserInputValue ) , telemetryClient . RecordedTelemetry [ 0 ] . Properties [ GetSuggestionTelemetryData . PropertyNameUserInput ] ) ;
687
+ Assert . Equal ( string . Join ( AzPredictorTelemetryClient . _StringValueConcatenator , expectedUserInputValue ) , telemetryClient . RecordedTelemetry [ 0 ] . Properties [ GetSuggestionTelemetryData . PropertyNameOuterUserInput ] ) ;
682
688
}
683
689
684
690
/// <summary>
@@ -703,7 +709,7 @@ private void VerifySameSuggestionSessionId()
703
709
Assert . EndsWith ( "Aggregation" , telemetryClient . RecordedTelemetry [ 0 ] . EventName ) ;
704
710
Assert . Equal ( MockObjects . PredictionClient . Name , telemetryClient . RecordedTelemetry [ 0 ] . Properties [ "ClientId" ] ) ;
705
711
var suggestionSessions = JsonSerializer . Deserialize < IList < IDictionary < string , object > > > ( telemetryClient . RecordedTelemetry [ 0 ] . Properties [ GetSuggestionTelemetryData . PropertyNamePrediction ] ) ;
706
- Assert . Equal ( "Clear-Content -Filter *** -Path ***" , ( ( JsonElement ) ( suggestionSessions [ 0 ] [ GetSuggestionTelemetryData . PropertyNameUserInput ] ) ) . GetString ( ) ) ;
712
+ Assert . Equal ( "Clear-Content -Filter *** -Path ***" , ( ( JsonElement ) ( suggestionSessions [ 0 ] [ GetSuggestionTelemetryData . PropertyNameInnerUserInput ] ) ) . GetString ( ) ) ;
707
713
Assert . Equal ( 1 , ( ( JsonElement ) suggestionSessions [ 0 ] [ GetSuggestionTelemetryData . PropertyNameFound ] ) . GetArrayLength ( ) ) ;
708
714
709
715
var displayCountOrIndex = 3 ;
@@ -870,7 +876,7 @@ public void VerifyExceptionInGetSuggestion()
870
876
871
877
Assert . EndsWith ( "Exception" , telemetryClient . RecordedTelemetry [ 0 ] . EventName ) ;
872
878
Assert . Equal ( MockObjects . PredictionClient . Name , telemetryClient . RecordedTelemetry [ 0 ] . Properties [ "ClientId" ] ) ;
873
- Assert . Equal ( AzPredictorConstants . CommandPlaceholder , telemetryClient . RecordedTelemetry [ 0 ] . Properties [ "UserInput" ] ) ;
879
+ Assert . Equal ( AzPredictorConstants . CommandPlaceholder , telemetryClient . RecordedTelemetry [ 0 ] . Properties [ GetSuggestionTelemetryData . PropertyNameOuterUserInput ] ) ;
874
880
Assert . StartsWith ( $ "Type: { typeof ( MockTestException ) } \n Stack Trace: ", telemetryClient . RecordedTelemetry [ 0 ] . Properties [ "Exception" ] ) ;
875
881
876
882
Assert . EndsWith ( "Aggregation" , telemetryClient . RecordedTelemetry [ 1 ] . EventName ) ;
@@ -1093,7 +1099,7 @@ public void VerifyAggregationDataSplitAtDisplaySuggestion()
1093
1099
var recordedTelemetry = telemetryClient . RecordedTelemetry [ 0 ] ;
1094
1100
var suggestionSessions = JsonSerializer . Deserialize < IList < IDictionary < string , object > > > ( recordedTelemetry . Properties [ GetSuggestionTelemetryData . PropertyNamePrediction ] ) ;
1095
1101
Assert . Equal ( expectedSuggestionSessionInFirstBatch , suggestionSessions . Count ( ) ) ;
1096
- Assert . True ( suggestionSessions . All ( ( s ) => s . ContainsKey ( GetSuggestionTelemetryData . PropertyNameFound ) && s . ContainsKey ( GetSuggestionTelemetryData . PropertyNameUserInput ) ) ) ;
1102
+ Assert . True ( suggestionSessions . All ( ( s ) => s . ContainsKey ( GetSuggestionTelemetryData . PropertyNameFound ) && s . ContainsKey ( GetSuggestionTelemetryData . PropertyNameInnerUserInput ) ) ) ;
1097
1103
Assert . True ( suggestionSessions . All ( ( s ) => ! s . ContainsKey ( SuggestionAcceptedTelemetryData . PropertyNameAccepted ) ) ) ;
1098
1104
Assert . True ( suggestionSessions . All ( ( s ) => ! s . ContainsKey ( SuggestionDisplayedTelemetryData . PropertyNameDisplayed ) ) ) ;
1099
1105
Assert . Equal ( suggestionPackage . Session . Value , ( ( JsonElement ) suggestionSessions . Last ( ) [ GetSuggestionTelemetryData . PropertyNameSuggestionSessionId ] ) . GetUInt32 ( ) ) ;
@@ -1102,7 +1108,7 @@ public void VerifyAggregationDataSplitAtDisplaySuggestion()
1102
1108
suggestionSessions = JsonSerializer . Deserialize < IList < IDictionary < string , object > > > ( recordedTelemetry . Properties [ GetSuggestionTelemetryData . PropertyNamePrediction ] ) ;
1103
1109
Assert . Equal ( expectedSuggestionSessionInSecondBatch , suggestionSessions . Count ( ) ) ;
1104
1110
Assert . False ( suggestionSessions [ 0 ] . ContainsKey ( GetSuggestionTelemetryData . PropertyNameFound ) ) ;
1105
- Assert . False ( suggestionSessions [ 0 ] . ContainsKey ( GetSuggestionTelemetryData . PropertyNameUserInput ) ) ;
1111
+ Assert . False ( suggestionSessions [ 0 ] . ContainsKey ( GetSuggestionTelemetryData . PropertyNameInnerUserInput ) ) ;
1106
1112
Assert . False ( suggestionSessions [ 0 ] . ContainsKey ( GetSuggestionTelemetryData . PropertyNameIsCancelled ) ) ;
1107
1113
Assert . Equal ( suggestionPackage . Session . Value , ( ( JsonElement ) suggestionSessions [ 0 ] [ GetSuggestionTelemetryData . PropertyNameSuggestionSessionId ] ) . GetUInt32 ( ) ) ;
1108
1114
Assert . Equal ( 1 , ( ( JsonElement ) suggestionSessions [ 0 ] [ SuggestionDisplayedTelemetryData . PropertyNameDisplayed ] ) [ 0 ] . GetInt32 ( ) ) ;
@@ -1151,7 +1157,7 @@ public void VerifyAggregationDataSplitAtAcceptSuggestion()
1151
1157
var recordedTelemetry = telemetryClient . RecordedTelemetry [ 0 ] ;
1152
1158
var suggestionSessions = JsonSerializer . Deserialize < IList < IDictionary < string , object > > > ( recordedTelemetry . Properties [ GetSuggestionTelemetryData . PropertyNamePrediction ] ) ;
1153
1159
Assert . Equal ( expectedSuggestionSessionInFirstBatch , suggestionSessions . Count ( ) ) ;
1154
- Assert . True ( suggestionSessions . All ( ( s ) => s . ContainsKey ( GetSuggestionTelemetryData . PropertyNameFound ) && s . ContainsKey ( GetSuggestionTelemetryData . PropertyNameUserInput ) ) ) ;
1160
+ Assert . True ( suggestionSessions . All ( ( s ) => s . ContainsKey ( GetSuggestionTelemetryData . PropertyNameFound ) && s . ContainsKey ( GetSuggestionTelemetryData . PropertyNameInnerUserInput ) ) ) ;
1155
1161
Assert . True ( suggestionSessions . All ( ( s ) => ! s . ContainsKey ( SuggestionAcceptedTelemetryData . PropertyNameAccepted ) ) ) ;
1156
1162
Assert . True ( suggestionSessions . SkipLast ( 1 ) . All ( ( s ) => ! s . ContainsKey ( SuggestionDisplayedTelemetryData . PropertyNameDisplayed ) && ! s . ContainsKey ( GetSuggestionTelemetryData . PropertyNameSuggestionSessionId ) ) ) ;
1157
1163
Assert . Equal ( suggestionPackage . Session . Value , ( ( JsonElement ) suggestionSessions . Last ( ) [ GetSuggestionTelemetryData . PropertyNameSuggestionSessionId ] ) . GetUInt32 ( ) ) ;
@@ -1162,7 +1168,7 @@ public void VerifyAggregationDataSplitAtAcceptSuggestion()
1162
1168
suggestionSessions = JsonSerializer . Deserialize < IList < IDictionary < string , object > > > ( recordedTelemetry . Properties [ GetSuggestionTelemetryData . PropertyNamePrediction ] ) ;
1163
1169
Assert . Equal ( expectedSuggestionSessionInSecondBatch , suggestionSessions . Count ( ) ) ;
1164
1170
Assert . False ( suggestionSessions [ 0 ] . ContainsKey ( GetSuggestionTelemetryData . PropertyNameFound ) ) ;
1165
- Assert . False ( suggestionSessions [ 0 ] . ContainsKey ( GetSuggestionTelemetryData . PropertyNameUserInput ) ) ;
1171
+ Assert . False ( suggestionSessions [ 0 ] . ContainsKey ( GetSuggestionTelemetryData . PropertyNameInnerUserInput ) ) ;
1166
1172
Assert . False ( suggestionSessions [ 0 ] . ContainsKey ( GetSuggestionTelemetryData . PropertyNameIsCancelled ) ) ;
1167
1173
Assert . Equal ( suggestionPackage . Session . Value , ( ( JsonElement ) suggestionSessions [ 0 ] [ GetSuggestionTelemetryData . PropertyNameSuggestionSessionId ] ) . GetUInt32 ( ) ) ;
1168
1174
Assert . Equal ( acceptedSuggestion , ( ( JsonElement ) suggestionSessions [ 0 ] [ SuggestionAcceptedTelemetryData . PropertyNameAccepted ] ) . GetString ( ) ) ;
0 commit comments