From 017ed03a705f47615f0c9429d369128072c89a04 Mon Sep 17 00:00:00 2001 From: Jerome Laban Date: Thu, 23 Apr 2020 17:17:35 -0400 Subject: [PATCH] fix: Adjust Dialog test to use the default dialog --- .../ViewModels/ShellViewModel.cs | 32 +++++++++---------- e2e/Uno/HelloUnoWorld.UITests/Dialog_Tests.cs | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/e2e/Uno/HelloUnoWorld.Shared/ViewModels/ShellViewModel.cs b/e2e/Uno/HelloUnoWorld.Shared/ViewModels/ShellViewModel.cs index 646c66de47..792f137931 100644 --- a/e2e/Uno/HelloUnoWorld.Shared/ViewModels/ShellViewModel.cs +++ b/e2e/Uno/HelloUnoWorld.Shared/ViewModels/ShellViewModel.cs @@ -42,7 +42,20 @@ private void ShowDialog() var message = "This is a message that should be shown in the dialog."; //using the dialog service as-is - //_dialogService.Show("NotificationDialog", new DialogParameters($"message={message}"), r => + _dialogService.ShowDialog("NotificationDialog", new DialogParameters($"message={message}"), r => + { + if (r.Result == ButtonResult.None) + Title = "Result is None"; + else if (r.Result == ButtonResult.OK) + Title = "Result is OK"; + else if (r.Result == ButtonResult.Cancel) + Title = "Result is Cancel"; + else + Title = "I Don't know what you did!?"; + }); + + //using custom extenions methods to simplify the app's dialogs + //_dialogService.ShowNotification(message, r => //{ // if (r.Result == ButtonResult.None) // Title = "Result is None"; @@ -54,8 +67,7 @@ private void ShowDialog() // Title = "I Don't know what you did!?"; //}); - //using custom extenions methods to simplify the app's dialogs - //_dialogService.ShowNotification(message, r => + //_dialogService.ShowConfirmation(message, r => //{ // if (r.Result == ButtonResult.None) // Title = "Result is None"; @@ -67,7 +79,7 @@ private void ShowDialog() // Title = "I Don't know what you did!?"; //}); - //_dialogService.ShowConfirmation(message, r => + //_dialogService.ShowNotificationInAnotherContentDialog(message, r => //{ // if (r.Result == ButtonResult.None) // Title = "Result is None"; @@ -78,18 +90,6 @@ private void ShowDialog() // else // Title = "I Don't know what you did!?"; //}); - - _dialogService.ShowNotificationInAnotherContentDialog(message, r => - { - if (r.Result == ButtonResult.None) - Title = "Result is None"; - else if (r.Result == ButtonResult.OK) - Title = "Result is OK"; - else if (r.Result == ButtonResult.Cancel) - Title = "Result is Cancel"; - else - Title = "I Don't know what you did!?"; - }); } } diff --git a/e2e/Uno/HelloUnoWorld.UITests/Dialog_Tests.cs b/e2e/Uno/HelloUnoWorld.UITests/Dialog_Tests.cs index ec22277be1..fb14731faa 100644 --- a/e2e/Uno/HelloUnoWorld.UITests/Dialog_Tests.cs +++ b/e2e/Uno/HelloUnoWorld.UITests/Dialog_Tests.cs @@ -12,7 +12,7 @@ namespace Sample.UITests public class Dialog_Tests : TestBase { [Test] - public void TestViewA() + public void ShowDialog() { Query testSelector = q => q.Marked("showDialog"); Query OkSelector = q => q.Marked("OKButton");