@@ -146,9 +146,9 @@ public void TrackRunEvent_FileBasedApp_SendsCorrectTelemetry()
146146 {
147147 // Arrange
148148 var events = new List < ( string ? eventName , IDictionary < string , string ? > ? properties , IDictionary < string , double > ? measurements ) > ( ) ;
149-
149+
150150 void handler ( object ? sender , InstrumentationEventArgs args ) => events . Add ( ( args . EventName , args . Properties , args . Measurements ) ) ;
151-
151+
152152 TelemetryEventEntry . EntryPosted += handler ;
153153
154154 try
@@ -172,18 +172,21 @@ public void TrackRunEvent_FileBasedApp_SendsCorrectTelemetry()
172172 var eventData = events [ 0 ] ;
173173 eventData . eventName . Should ( ) . Be ( "run" ) ;
174174 eventData . properties . Should ( ) . NotBeNull ( ) ;
175-
175+ eventData . measurements . Should ( ) . NotBeNull ( ) ;
176+
176177 var props = eventData . properties ! ;
177178 props [ "app_type" ] . Should ( ) . Be ( "file_based" ) ;
178179 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" ) ;
183180 props [ "used_msbuild" ] . Should ( ) . Be ( "true" ) ;
184181 props [ "used_roslyn_compiler" ] . Should ( ) . Be ( "false" ) ;
185182 props [ "launch_profile_requested" ] . Should ( ) . Be ( "explicit" ) ;
186183 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 ) ;
187190 }
188191 finally
189192 {
@@ -197,9 +200,9 @@ public void TrackRunEvent_ProjectBasedApp_SendsCorrectTelemetry()
197200 {
198201 // Arrange
199202 var events = new List < ( string ? eventName , IDictionary < string , string ? > ? properties , IDictionary < string , double > ? measurements ) > ( ) ;
200-
203+
201204 void handler ( object ? sender , InstrumentationEventArgs args ) => events . Add ( ( args . EventName , args . Properties , args . Measurements ) ) ;
202-
205+
203206 TelemetryEventEntry . EntryPosted += handler ;
204207
205208 try
@@ -220,17 +223,20 @@ public void TrackRunEvent_ProjectBasedApp_SendsCorrectTelemetry()
220223 var eventData = events [ 0 ] ;
221224 eventData . eventName . Should ( ) . Be ( "run" ) ;
222225 eventData . properties . Should ( ) . NotBeNull ( ) ;
223-
226+ eventData . measurements . Should ( ) . NotBeNull ( ) ;
227+
224228 var props = eventData . properties ! ;
225229 props [ "app_type" ] . Should ( ) . Be ( "project_based" ) ;
226230 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" ) ;
230231 props [ "launch_profile_requested" ] . Should ( ) . Be ( "none" ) ;
231- props . Should ( ) . NotContainKey ( "additional_properties_count" ) ;
232232 props . Should ( ) . NotContainKey ( "used_msbuild" ) ;
233233 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" ) ;
234240 }
235241 finally
236242 {
@@ -244,9 +250,9 @@ public void TrackRunEvent_WithDefaultLaunchProfile_MarksTelemetryCorrectly()
244250 {
245251 // Arrange
246252 var events = new List < ( string ? eventName , IDictionary < string , string ? > ? properties , IDictionary < string , double > ? measurements ) > ( ) ;
247-
253+
248254 void handler ( object ? sender , InstrumentationEventArgs args ) => events . Add ( ( args . EventName , args . Properties , args . Measurements ) ) ;
249-
255+
250256 TelemetryEventEntry . EntryPosted += handler ;
251257
252258 var launchSettings = new ProjectLaunchSettingsModel
0 commit comments