@@ -135,7 +135,7 @@ private EditorMeasurement CreateEditorMeasurement() {
135
135
var analytics = new EditorMeasurement ( settings , ProjectSettings . logger , GA_TRACKING_ID ,
136
136
SETTINGS_NAMESPACE , PLUGIN_NAME ,
137
137
DATA_COLLECTION_DESCRIPTION , PRIVACY_POLICY ) ;
138
- analytics . displayDialog = ( title , message , defaultOption , option0 , option1 ,
138
+ analytics . displayDialog = ( title , message , defaultOption , option0 , option1 , Nullable ,
139
139
windowWidth , windowCloseOption ,
140
140
complete , renderContent , renderButtons , init ) => {
141
141
throw new Exception ( "Unexpected dialog displayed" ) ;
@@ -187,18 +187,19 @@ public void Construct() {
187
187
private DialogWindow . DisplayDelegate CreateDisplayDialogDelegate (
188
188
List < DialogWindow . Option > selectedOptions ) {
189
189
return ( string title , string message , DialogWindow . Option defaultOption ,
190
- string option0 , string option1 ,
190
+ string option0 , string option1 , string option2 ,
191
191
float windowWidth , DialogWindow . Option windowCloseOption ,
192
192
Action < DialogWindow . Option > complete ,
193
193
Action < DialogWindow > renderContent ,
194
194
Action < DialogWindow > renderButtons ,
195
195
Action < DialogWindow > init ) => {
196
196
Assert . That ( title , Is . Not . Empty ) ;
197
197
Assert . That ( message , Is . Not . Empty ) ;
198
- Assert . That ( defaultOption , Is . EqualTo ( DialogWindow . Option . Selected0 ) ) ;
198
+ Assert . That ( defaultOption , Is . EqualTo ( DialogWindow . Option . Selected1 ) ) ;
199
199
Assert . That ( option0 , Is . Not . Empty ) ;
200
200
Assert . That ( option1 , Is . Not . Empty ) ;
201
- Assert . That ( windowCloseOption , Is . EqualTo ( DialogWindow . Option . Selected0 ) ) ;
201
+ Assert . That ( option2 , Is . Null ) ;
202
+ Assert . That ( windowCloseOption , Is . EqualTo ( DialogWindow . Option . SelectedNone ) ) ;
202
203
Assert . That ( complete , Is . Not . Null ) ;
203
204
Assert . That ( renderContent , Is . Not . Null ) ;
204
205
Assert . That ( renderButtons , Is . Not . Null ) ;
@@ -216,7 +217,7 @@ public void PromptToEnableYes() {
216
217
var analytics = CreateEditorMeasurement ( ) ;
217
218
analytics . displayDialog = CreateDisplayDialogDelegate (
218
219
new List < DialogWindow . Option > {
219
- DialogWindow . Option . Selected1 /* yes */
220
+ DialogWindow . Option . Selected0 /* yes */
220
221
} ) ;
221
222
Assert . That ( analytics . Enabled , Is . EqualTo ( true ) ) ;
222
223
Assert . That ( analytics . ConsentRequested , Is . EqualTo ( false ) ) ;
@@ -234,7 +235,7 @@ public void PromptToEnableNo() {
234
235
var analytics = CreateEditorMeasurement ( ) ;
235
236
analytics . displayDialog = CreateDisplayDialogDelegate (
236
237
new List < DialogWindow . Option > {
237
- DialogWindow . Option . Selected0 /* no */
238
+ DialogWindow . Option . Selected1 /* no */
238
239
} ) ;
239
240
Assert . That ( analytics . Enabled , Is . EqualTo ( true ) ) ;
240
241
Assert . That ( analytics . ConsentRequested , Is . EqualTo ( false ) ) ;
@@ -253,7 +254,7 @@ public void RestoreDefaultSettings() {
253
254
var analytics = CreateEditorMeasurement ( ) ;
254
255
analytics . displayDialog = CreateDisplayDialogDelegate (
255
256
new List < DialogWindow . Option > {
256
- DialogWindow . Option . Selected0 /* no */
257
+ DialogWindow . Option . Selected1 /* no */
257
258
} ) ;
258
259
Assert . That ( analytics . Enabled , Is . EqualTo ( true ) ) ;
259
260
Assert . That ( analytics . ConsentRequested , Is . EqualTo ( false ) ) ;
@@ -275,7 +276,7 @@ public void GenerateCookies() {
275
276
var analytics = CreateEditorMeasurement ( ) ;
276
277
analytics . displayDialog = CreateDisplayDialogDelegate (
277
278
new List < DialogWindow . Option > {
278
- DialogWindow . Option . Selected1 /* yes */
279
+ DialogWindow . Option . Selected0 /* yes */
279
280
} ) ;
280
281
Assert . That ( analytics . Cookie , Is . EqualTo ( "" ) ) ;
281
282
Assert . That ( analytics . SystemCookie , Is . EqualTo ( "" ) ) ;
@@ -292,7 +293,7 @@ public void GenerateCookies() {
292
293
public void ReportWithoutConsent ( ) {
293
294
var analytics = CreateEditorMeasurement ( ) ;
294
295
var selectedOptions = new List < DialogWindow . Option > {
295
- DialogWindow . Option . Selected0 /* no */ } ;
296
+ DialogWindow . Option . Selected1 /* no */ } ;
296
297
analytics . displayDialog = CreateDisplayDialogDelegate ( selectedOptions ) ;
297
298
analytics . Report ( "/a/new/event" , "something interesting" ) ;
298
299
analytics . Report ( "/a/new/event" , "something else" ) ;
@@ -375,7 +376,7 @@ private KeyValuePair<string, string>[] CreateMeasurementEvents(
375
376
public void ReportWithConsent ( ) {
376
377
var analytics = CreateEditorMeasurement ( ) ;
377
378
var selectedOptions = new List < DialogWindow . Option > {
378
- DialogWindow . Option . Selected1 /* yes */ } ;
379
+ DialogWindow . Option . Selected0 /* yes */ } ;
379
380
analytics . displayDialog = CreateDisplayDialogDelegate ( selectedOptions ) ;
380
381
analytics . Report ( "/a/new/event" , "something interesting" ) ;
381
382
analytics . Report ( "/a/new/event#neat" , "something else" ) ;
@@ -415,7 +416,7 @@ public void ReportWithConsentWithBasePathQueryAndReportName() {
415
416
analytics . BaseQuery = "version=1.2.3" ;
416
417
analytics . BaseReportName = "My Plugin: " ;
417
418
var selectedOptions = new List < DialogWindow . Option > {
418
- DialogWindow . Option . Selected1 /* yes */ } ;
419
+ DialogWindow . Option . Selected0 /* yes */ } ;
419
420
analytics . displayDialog = CreateDisplayDialogDelegate ( selectedOptions ) ;
420
421
analytics . Report ( "/a/new/event" , "something interesting" ) ;
421
422
Assert . That ( webRequest . PostedUrlAndForms ,
@@ -439,7 +440,7 @@ public void ReportWithConsentWithBasePathQueryCommonParamsAndReportName() {
439
440
analytics . BaseQuery = "version=1.2.3" ;
440
441
analytics . BaseReportName = "My Plugin: " ;
441
442
var selectedOptions = new List < DialogWindow . Option > {
442
- DialogWindow . Option . Selected1 /* yes */ } ;
443
+ DialogWindow . Option . Selected0 /* yes */ } ;
443
444
analytics . displayDialog = CreateDisplayDialogDelegate ( selectedOptions ) ;
444
445
analytics . Report ( "/a/new/event" , "something interesting" ) ;
445
446
Assert . That ( webRequest . PostedUrlAndForms ,
@@ -463,7 +464,7 @@ public void TestInstallSourceFilename(string filename, string expectedInstallSou
463
464
analytics . InstallSource = null ;
464
465
analytics . InstallSourceFilename = filename ;
465
466
var selectedOptions = new List < DialogWindow . Option > {
466
- DialogWindow . Option . Selected1 /* yes */ } ;
467
+ DialogWindow . Option . Selected0 /* yes */ } ;
467
468
analytics . displayDialog = CreateDisplayDialogDelegate ( selectedOptions ) ;
468
469
analytics . Report ( "/a/new/event" , "something interesting" ) ;
469
470
Assert . That ( webRequest . PostedUrlAndForms ,
@@ -506,7 +507,7 @@ public void ReportWithConsentWithInstallSourceFilenameLibrary() {
506
507
public void OpenUrl ( ) {
507
508
var analytics = CreateEditorMeasurement ( ) ;
508
509
var selectedOptions = new List < DialogWindow . Option > {
509
- DialogWindow . Option . Selected1 /* yes */ } ;
510
+ DialogWindow . Option . Selected0 /* yes */ } ;
510
511
analytics . displayDialog = CreateDisplayDialogDelegate ( selectedOptions ) ;
511
512
analytics . OpenUrl ( "https://github.com/googlesamples/unity-jar-resolver?do=something" +
512
513
"#version-handler-usage" , "Version Handler Usage" ) ;
0 commit comments