Skip to content

Commit

Permalink
chore: Adjust for WinUI
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Dec 3, 2024
1 parent 4d921df commit b1f25a2
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -446,19 +446,23 @@ public async Task When_Exception_In_Page_Ctor()
Height = 200
};

#if HAS_UNO
bool navigationFailed = false;
SUT.NavigationFailed += (s, e) => navigationFailed = true;
#endif

TestServices.WindowHelper.WindowContent = SUT;
await TestServices.WindowHelper.WaitForLoaded(SUT);

var exception = Assert.ThrowsException<NotSupportedException>(() => SUT.Navigate(typeof(ExceptionInCtorPage)));
Assert.AreEqual("Crashed", exception.Message);
#if HAS_UNO
if (FeatureConfiguration.Frame.UseWinUIBehavior)
{
// This is only valid with WinUI Frame behavior
Assert.IsFalse(navigationFailed);
}
#endif
}

[TestMethod]
Expand Down

0 comments on commit b1f25a2

Please sign in to comment.