Skip to content

Commit f631a2d

Browse files
Adding UI tests without assertions to easily test behavior
The intention is to eventually add some assertions, but we'll need to figure out what is relevant to assert on.
1 parent 721a25c commit f631a2d

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

tests/MaterialDesignThemes.UITests/WPF/TabControls/TabControlTests.cs

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,56 @@ public async Task TabControl_ShouldRespectSelectedContentTemplate_WhenSetDirectl
152152

153153
recorder.Success();
154154
}
155+
156+
[Test]
157+
public async Task ScrollingTabs_UniformGrid()
158+
{
159+
await using var recorder = new TestRecorder(App);
160+
161+
//Arrange
162+
const int numTabs = 10;
163+
StringBuilder xaml = new("<TabControl>");
164+
for (int i = 1; i <= numTabs; i++)
165+
{
166+
xaml.Append($"""
167+
<TabItem Header="TAB {i}">
168+
<TextBlock Margin="8" Text="Tab {i}" />
169+
</TabItem>
170+
""");
171+
}
172+
xaml.Append("</TabControl>");
173+
IVisualElement<TabControl> tabControl = await LoadXaml<TabControl>(xaml.ToString());
174+
175+
//Act
176+
177+
//Assert
178+
179+
recorder.Success();
180+
}
181+
182+
[Test]
183+
public async Task ScrollingTabs_VirtualizingStackPanel()
184+
{
185+
await using var recorder = new TestRecorder(App);
186+
187+
//Arrange
188+
const int numTabs = 10;
189+
StringBuilder xaml = new("<TabControl HorizontalContentAlignment=\"Left\">");
190+
for (int i = 1; i <= numTabs; i++)
191+
{
192+
xaml.Append($"""
193+
<TabItem Header="TAB {i}">
194+
<TextBlock Margin="8" Text="Tab {i}" />
195+
</TabItem>
196+
""");
197+
}
198+
xaml.Append("</TabControl>");
199+
IVisualElement<TabControl> tabControl = await LoadXaml<TabControl>(xaml.ToString());
200+
201+
//Act
202+
203+
//Assert
204+
205+
recorder.Success();
206+
}
155207
}

0 commit comments

Comments
 (0)