Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Refactoring test harness to expose Navigator property #807

Merged
merged 1 commit into from
Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions testing/TestHarness/TestHarness.Shared/BaseTestSectionPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ protected override void OnNavigatedTo(NavigationEventArgs e)
}
}

protected INavigator Navigator
{
get
{
var root = this.FindName(Constants.NavigationRoot) as ContentControl;
return (root!.Content as FrameworkElement)!.Navigator()!;
}
}

private bool init;
private async Task InitializeHost()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ public CustomAuthenticationMainPage()

public async void ShowAppClick(object sender, RoutedEventArgs e)
{
await NavigationRoot.Navigator()!.NavigateRouteAsync(this,"");
await Navigator.NavigateRouteAsync(this,"");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public MsalAuthenticationMainPage()

public async void ShowAppClick(object sender, RoutedEventArgs e)
{
await NavigationRoot.Navigator()!.NavigateRouteAsync(this,"");
await Navigator.NavigateRouteAsync(this,"");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ public OidcAuthenticationMainPage()

public async void ShowAppClick(object sender, RoutedEventArgs e)
{
await NavigationRoot.Navigator()!.NavigateRouteAsync(this,"");
await Navigator.NavigateRouteAsync(this,"");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public WebAuthenticationMainPage()

public async void ShowAppClick(object sender, RoutedEventArgs e)
{
await NavigationRoot.Navigator()!.NavigateRouteAsync(this,"");
await Navigator.NavigateRouteAsync(this,"");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public StorageMainPage()

public async void OnePageClick(object sender, RoutedEventArgs e)
{
await NavigationRoot.Navigator()!.NavigateViewModelAsync<StorageOneViewModel>(this);
await Navigator.NavigateViewModelAsync<StorageOneViewModel>(this);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public HttpEndpointsMainPage()

public async void OnePageClick(object sender, RoutedEventArgs e)
{
await NavigationRoot.Navigator()!.NavigateViewModelAsync<HttpEndpointsOneViewModel>(this);
await Navigator.NavigateViewModelAsync<HttpEndpointsOneViewModel>(this);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public HttpRefitMainPage()

public async void OnePageClick(object sender, RoutedEventArgs e)
{
await NavigationRoot.Navigator()!.NavigateViewModelAsync<HttpRefitOneViewModel>(this);
await Navigator.NavigateViewModelAsync<HttpRefitOneViewModel>(this);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public LocalizationMainPage()

public async void OnePageClick(object sender, RoutedEventArgs e)
{
await NavigationRoot.Navigator()!.NavigateViewModelAsync<LocalizationOneViewModel>(this);
await Navigator.NavigateViewModelAsync<LocalizationOneViewModel>(this);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public CommerceMainPage()

public async void ShowAppClick(object sender, RoutedEventArgs e)
{
await NavigationRoot.Navigator()!.NavigateRouteAsync(this,"");
await Navigator.NavigateRouteAsync(this,"");
}
public async void NarrowClick(object sender, RoutedEventArgs e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public ToDoMainPage()

public async void ShowAppClick(object sender, RoutedEventArgs e)
{
await NavigationRoot.Navigator()!.NavigateRouteAsync(this,"");
await Navigator.NavigateRouteAsync(this,"");
}
public async void NarrowClick(object sender, RoutedEventArgs e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ public DialogsMainPage()

public async void MessageDialogsClick(object sender, RoutedEventArgs e)
{
await NavigationRoot.Navigator()!.NavigateViewAsync<MessageDialogsPage>(this);
await Navigator.NavigateViewAsync<MessageDialogsPage>(this);
}

public async void LocalizedDialogsClick(object sender, RoutedEventArgs e)
{
await NavigationRoot.Navigator()!.NavigateViewAsync<LocalizedDialogsPage>(this);
await Navigator.NavigateViewAsync<LocalizedDialogsPage>(this);
}

public async void ContentDialogsClick(object sender, RoutedEventArgs e)
{
await NavigationRoot.Navigator()!.NavigateViewAsync<ContentDialogsPage>(this);
await Navigator.NavigateViewAsync<ContentDialogsPage>(this);
}
public async void FlyoutsClick(object sender, RoutedEventArgs e)
{
await NavigationRoot.Navigator()!.NavigateViewAsync<DialogsFlyoutsPage>(this);
await Navigator.NavigateViewAsync<DialogsFlyoutsPage>(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ public ListToDetailsMainPage()

public async void ListToDetailsHomeClick(object sender, RoutedEventArgs e)
{
await NavigationRoot.Navigator()!.NavigateViewModelAsync<ListToDetailsHomeViewModel>(this);
await Navigator.NavigateViewModelAsync<ListToDetailsHomeViewModel>(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public NavigationViewMainPage()

public async void NavigationViewHomeClick(object sender, RoutedEventArgs e)
{
await NavigationRoot.Navigator()!.NavigateViewModelAsync<NavigationViewHomeViewModel>(this);
await Navigator.NavigateViewModelAsync<NavigationViewHomeViewModel>(this);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public PageNavigationMainPage()

public async void OnePageClick(object sender, RoutedEventArgs e)
{
await NavigationRoot.Navigator()!.NavigateViewModelAsync<PageNavigationOneViewModel>(this);
await Navigator.NavigateViewModelAsync<PageNavigationOneViewModel>(this);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public ReactiveMainPage()

public async void OnePageClick(object sender, RoutedEventArgs e)
{
await NavigationRoot.Navigator()!.NavigateViewModelAsync<ReactiveOneViewModel>(this);
await Navigator.NavigateViewModelAsync<ReactiveOneViewModel>(this);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public ResponsiveMainPage()

public async void ResponsiveHomeClick(object sender, RoutedEventArgs e)
{
await NavigationRoot.Navigator()!.NavigateViewModelAsync<ResponsiveHomeViewModel>(this);
await Navigator.NavigateViewModelAsync<ResponsiveHomeViewModel>(this);
}
public async void NarrowClick(object sender, RoutedEventArgs e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public TabBarMainPage()

public async void TabBarHomeClick(object sender, RoutedEventArgs e)
{
await NavigationRoot.Navigator()!.NavigateViewModelAsync<TabBarHomeViewModel>(this);
await Navigator.NavigateViewModelAsync<TabBarHomeViewModel>(this);
}

}