@@ -146,9 +146,9 @@ public void TrackRunEvent_FileBasedApp_SendsCorrectTelemetry()
146
146
{
147
147
// Arrange
148
148
var events = new List < ( string ? eventName , IDictionary < string , string ? > ? properties , IDictionary < string , double > ? measurements ) > ( ) ;
149
-
149
+
150
150
void handler ( object ? sender , InstrumentationEventArgs args ) => events . Add ( ( args . EventName , args . Properties , args . Measurements ) ) ;
151
-
151
+
152
152
TelemetryEventEntry . EntryPosted += handler ;
153
153
154
154
try
@@ -172,18 +172,21 @@ public void TrackRunEvent_FileBasedApp_SendsCorrectTelemetry()
172
172
var eventData = events [ 0 ] ;
173
173
eventData . eventName . Should ( ) . Be ( "run" ) ;
174
174
eventData . properties . Should ( ) . NotBeNull ( ) ;
175
-
175
+ eventData . measurements . Should ( ) . NotBeNull ( ) ;
176
+
176
177
var props = eventData . properties ! ;
177
178
props [ "app_type" ] . Should ( ) . Be ( "file_based" ) ;
178
179
props [ "project_id" ] . Should ( ) . Be ( "test-hash" ) ;
179
- props [ "sdk_count" ] . Should ( ) . Be ( "2" ) ;
180
- props [ "package_reference_count" ] . Should ( ) . Be ( "3" ) ;
181
- props [ "project_reference_count" ] . Should ( ) . Be ( "1" ) ;
182
- props [ "additional_properties_count" ] . Should ( ) . Be ( "2" ) ;
183
180
props [ "used_msbuild" ] . Should ( ) . Be ( "true" ) ;
184
181
props [ "used_roslyn_compiler" ] . Should ( ) . Be ( "false" ) ;
185
182
props [ "launch_profile_requested" ] . Should ( ) . Be ( "explicit" ) ;
186
183
props [ "launch_profile_is_default" ] . Should ( ) . Be ( "true" ) ;
184
+
185
+ var measurements = eventData . measurements ! ;
186
+ measurements [ "sdk_count" ] . Should ( ) . Be ( 2 ) ;
187
+ measurements [ "package_reference_count" ] . Should ( ) . Be ( 3 ) ;
188
+ measurements [ "project_reference_count" ] . Should ( ) . Be ( 1 ) ;
189
+ measurements [ "additional_properties_count" ] . Should ( ) . Be ( 2 ) ;
187
190
}
188
191
finally
189
192
{
@@ -197,9 +200,9 @@ public void TrackRunEvent_ProjectBasedApp_SendsCorrectTelemetry()
197
200
{
198
201
// Arrange
199
202
var events = new List < ( string ? eventName , IDictionary < string , string ? > ? properties , IDictionary < string , double > ? measurements ) > ( ) ;
200
-
203
+
201
204
void handler ( object ? sender , InstrumentationEventArgs args ) => events . Add ( ( args . EventName , args . Properties , args . Measurements ) ) ;
202
-
205
+
203
206
TelemetryEventEntry . EntryPosted += handler ;
204
207
205
208
try
@@ -220,17 +223,20 @@ public void TrackRunEvent_ProjectBasedApp_SendsCorrectTelemetry()
220
223
var eventData = events [ 0 ] ;
221
224
eventData . eventName . Should ( ) . Be ( "run" ) ;
222
225
eventData . properties . Should ( ) . NotBeNull ( ) ;
223
-
226
+ eventData . measurements . Should ( ) . NotBeNull ( ) ;
227
+
224
228
var props = eventData . properties ! ;
225
229
props [ "app_type" ] . Should ( ) . Be ( "project_based" ) ;
226
230
props [ "project_id" ] . Should ( ) . Be ( "project-hash" ) ;
227
- props [ "sdk_count" ] . Should ( ) . Be ( "1" ) ;
228
- props [ "package_reference_count" ] . Should ( ) . Be ( "5" ) ;
229
- props [ "project_reference_count" ] . Should ( ) . Be ( "2" ) ;
230
231
props [ "launch_profile_requested" ] . Should ( ) . Be ( "none" ) ;
231
- props . Should ( ) . NotContainKey ( "additional_properties_count" ) ;
232
232
props . Should ( ) . NotContainKey ( "used_msbuild" ) ;
233
233
props . Should ( ) . NotContainKey ( "used_roslyn_compiler" ) ;
234
+
235
+ var measurements = eventData . measurements ! ;
236
+ measurements [ "sdk_count" ] . Should ( ) . Be ( 1 ) ;
237
+ measurements [ "package_reference_count" ] . Should ( ) . Be ( 5 ) ;
238
+ measurements [ "project_reference_count" ] . Should ( ) . Be ( 2 ) ;
239
+ measurements . Should ( ) . NotContainKey ( "additional_properties_count" ) ;
234
240
}
235
241
finally
236
242
{
@@ -244,9 +250,9 @@ public void TrackRunEvent_WithDefaultLaunchProfile_MarksTelemetryCorrectly()
244
250
{
245
251
// Arrange
246
252
var events = new List < ( string ? eventName , IDictionary < string , string ? > ? properties , IDictionary < string , double > ? measurements ) > ( ) ;
247
-
253
+
248
254
void handler ( object ? sender , InstrumentationEventArgs args ) => events . Add ( ( args . EventName , args . Properties , args . Measurements ) ) ;
249
-
255
+
250
256
TelemetryEventEntry . EntryPosted += handler ;
251
257
252
258
var launchSettings = new ProjectLaunchSettingsModel
0 commit comments