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

Enable TabbedPage tests #3176

Merged
merged 1 commit into from
Jul 4, 2024
Merged
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
17 changes: 13 additions & 4 deletions tests/Maui/Prism.Maui.Tests/Fixtures/Common/MvvmHelperFixture.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
using Moq;
using Prism.Common;

namespace Prism.Maui.Tests.Fixtures.Common;

public class MvvmHelperFixture
{
public MvvmHelperFixture()
{
var provider = new Mock<IDispatcherProvider>();
provider.Setup(x => x.GetForCurrentThread()).Returns(Mock.Of<IDispatcher>());

DispatcherProvider.SetCurrent(provider.Object);
}

/// <summary>
/// This test was introduced to verify GH3143
/// </summary>
Expand Down Expand Up @@ -96,12 +105,12 @@ public async Task GetCurrentPageFromContentPageWithModalReturnsContentPage()
/// This test was introduced to verify GH3143
/// </summary>
/// <a href="https://github.com/PrismLibrary/Prism/issues/3143">Git Hub Issue 3143</a>
[Fact(Skip = "System.InvalidOperationException\nBindableObject was not instantiated on a thread with a dispatcher nor does the current application have a dispatcher.")]
[Fact]
public async Task GetCurrentPageFromTabbedPageWithModalReturnsContentPage()
{
// Given
var expected = new ContentPage();
var tabbedPage = new TabbedPage { Title = "Tab", Children = { expected }};
var tabbedPage = new TabbedPage { Title = "Tab", Children = { expected } };
var window = new Window { Page = tabbedPage };
await window.Navigation.PushModalAsync(new DialogContainerPage());

Expand All @@ -116,13 +125,13 @@ public async Task GetCurrentPageFromTabbedPageWithModalReturnsContentPage()
/// This test was introduced to verify GH3143
/// </summary>
/// <a href="https://github.com/PrismLibrary/Prism/issues/3143">Git Hub Issue 3143</a>
[Fact(Skip = "System.InvalidOperationException\nBindableObject was not instantiated on a thread with a dispatcher nor does the current application have a dispatcher.")]
[Fact]
public async Task GetCurrentPageFromTabbedNavigationPageWithModalReturnsContentPage()
{
// Given
var expected = new ContentPage();
var navigationPage = new NavigationPage(expected);
var tabbedPage = new TabbedPage { Title = "Tab", Children = { navigationPage }};
var tabbedPage = new TabbedPage { Title = "Tab", Children = { navigationPage } };
var window = new Window { Page = tabbedPage };
await window.Navigation.PushModalAsync(new DialogContainerPage());

Expand Down
Loading