From f757300b68b127069dfafead8edb1a449f23717b Mon Sep 17 00:00:00 2001
From: rlittlesii <6969701+RLittlesII@users.noreply.github.com>
Date: Fri, 24 May 2024 17:05:26 -0500
Subject: [PATCH] separate tests
clean up test naming
ensuring bug is attached to each test
---
.../Fixtures/Common/MvvmHelperFixture.cs | 98 ++++++++++++++-----
1 file changed, 72 insertions(+), 26 deletions(-)
diff --git a/tests/Maui/Prism.Maui.Tests/Fixtures/Common/MvvmHelperFixture.cs b/tests/Maui/Prism.Maui.Tests/Fixtures/Common/MvvmHelperFixture.cs
index 90c3da0c4..63846b6c7 100644
--- a/tests/Maui/Prism.Maui.Tests/Fixtures/Common/MvvmHelperFixture.cs
+++ b/tests/Maui/Prism.Maui.Tests/Fixtures/Common/MvvmHelperFixture.cs
@@ -1,6 +1,4 @@
-using System.Collections;
using Prism.Common;
-using Prism.Maui.Tests.Mocks.Views;
namespace Prism.Maui.Tests.Fixtures.Common;
@@ -10,40 +8,88 @@ public class MvvmHelperFixture
/// This test was introduced to verify GH3143
///
/// Git Hub Issue 3143
- /// The window representing the root of the navigation.
- /// The actual page we expect to return.
- /// The model page we are pushing on the stack that causes the problem.
- [Theory]
- [ClassData(typeof(GetCurrentPageTestData))]
- public async Task GetCurrentPageWithModalReturnsPrismWindowPage(Window window, Page page, Page modal)
+ [Fact]
+ public async Task GetCurrentPageFromFlyoutPageWithModalReturnsDetailPage()
{
// Given
- await window.Navigation.PushModalAsync(modal);
+ FlyoutPage flyout = new FlyoutPage
+ { Flyout = new ContentPage { Title = "Title" }, Detail = new NavigationPage(), };
+ PrismWindow window = new PrismWindow { Page = flyout };
+ await window.Navigation.PushModalAsync(new DialogContainerPage());
// When
var result = MvvmHelpers.GetCurrentPage(window.Page);
// Then
- Assert.Equal(result, page);
+ Assert.Equal(result, flyout.Detail);
}
- private class GetCurrentPageTestData : IEnumerable