-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Expand file tree
/
Copy pathToolBarTests.cs
More file actions
58 lines (46 loc) · 1.85 KB
/
ToolBarTests.cs
File metadata and controls
58 lines (46 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System.ComponentModel;
using System.Windows.Media;
namespace MaterialDesignThemes.UITests.WPF.ToolBars;
public class ToolBarTests : TestBase
{
[Description("Issue 2991")]
[Test]
[Arguments(Orientation.Horizontal, Dock.Right)]
[Arguments(Orientation.Vertical, Dock.Bottom)]
public async Task ToolBar_OverflowGrid_RespectsOrientation(Orientation orientation, Dock expectedOverflowGridDock)
{
await using var recorder = new TestRecorder(App);
//Arrange
var toolBarTray = await LoadXaml<ToolBarTray>($@"
<ToolBarTray Orientation=""{orientation}"" DockPanel.Dock=""Top"">
<ToolBar Style=""{{StaticResource MaterialDesignToolBar}}"">
<Button Content=""{{materialDesign:PackIcon Kind=File}}""/>
</ToolBar>
</ToolBarTray>");
var overflowGrid = await toolBarTray.GetElement<Grid>("OverflowGrid");
//Act
Dock dock = await overflowGrid.GetProperty<Dock>(DockPanel.DockProperty);
//Assert
await Assert.That(dock).IsEqualTo(expectedOverflowGridDock);
recorder.Success();
}
[Description("Issue 3694")]
[Test]
public async Task ToolBar_OverflowButton_InheritsCustomBackground()
{
await using var recorder = new TestRecorder(App);
//Arrange
var toolBarTray = await LoadXaml<ToolBarTray>(@"
<ToolBarTray DockPanel.Dock=""Top"">
<ToolBar Style=""{StaticResource MaterialDesignToolBar}"" Background=""Fuchsia"" OverflowMode=""Always"">
<Button Content=""{materialDesign:PackIcon Kind=File}""/>
</ToolBar>
</ToolBarTray>");
var overflowButton = await toolBarTray.GetElement<ToggleButton>("OverflowButton");
//Act
Color? overflowBackground = await overflowButton.GetBackgroundColor();
//Assert
await Assert.That(overflowBackground).IsEqualTo(Colors.Fuchsia);
recorder.Success();
}
}