generated from unoplatform/template
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix SelectorExtensions not updating NumberOfPages on Selector lo…
…ad (#565) * fix: Fix SelectorExtensions not updating NumberOfPages on Selector load * chore: Fix build
- Loading branch information
1 parent
6d54745
commit cccd79f
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
src/Uno.Toolkit.RuntimeTests/Tests/SelectorExtensionsTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using Uno.UI.RuntimeTests; | ||
using Uno.Toolkit.RuntimeTests.Helpers; | ||
using System.Threading.Tasks; | ||
using Uno.Toolkit.UI; | ||
using Microsoft.UI.Xaml.Controls; | ||
|
||
#if !IS_WINUI | ||
using Windows.UI.Xaml.Controls; | ||
#endif | ||
|
||
namespace Uno.Toolkit.RuntimeTests.Tests | ||
{ | ||
[TestClass] | ||
[RunsOnUIThread] | ||
public class SelectorExtensionsTests | ||
{ | ||
[TestMethod] | ||
public async Task TestAddingItemsBeforeLoadedAndAfterSetPipsPager() | ||
{ | ||
var grid = new Grid(); | ||
var flipView = new FlipView(); | ||
var pipsPager = new PipsPager(); | ||
grid.Children.Add(flipView); | ||
grid.Children.Add(pipsPager); | ||
SelectorExtensions.SetPipsPager(flipView, pipsPager); | ||
flipView.Items.Add("Test1"); | ||
flipView.Items.Add("Test2"); | ||
flipView.Items.Add("Test3"); | ||
await UnitTestUIContentHelperEx.SetContentAndWait(grid); | ||
Assert.AreEqual(3, pipsPager.NumberOfPages); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters