|
3 | 3 | // See the LICENSE file in the project root for more information. |
4 | 4 |
|
5 | 5 | using CommunityToolkit.Tests; |
| 6 | +using CommunityToolkit.Tooling.TestGen; |
6 | 7 | using CommunityToolkit.WinUI.Automation.Peers; |
7 | 8 | using CommunityToolkit.WinUI.Controls; |
8 | 9 |
|
9 | 10 | namespace TokenizingTextBoxExperiment.Tests; |
10 | 11 |
|
11 | 12 | [TestClass] |
12 | 13 | [TestCategory("Test_TokenizingTextBox")] |
13 | | -public class Test_TokenizingTextBox_AutomationPeer : VisualUITestBase |
| 14 | +public partial class Test_TokenizingTextBox_AutomationPeer : VisualUITestBase |
14 | 15 | { |
15 | 16 | [TestMethod] |
16 | 17 | public async Task ShouldConfigureTokenizingTextBoxAutomationPeerAsync() |
@@ -83,24 +84,21 @@ await App.DispatcherQueue.EnqueueAsync(async () => |
83 | 84 | }); |
84 | 85 | } |
85 | 86 |
|
86 | | - [TestMethod] |
| 87 | + [UIThreadTestMethod] |
87 | 88 | public async Task ShouldThrowElementNotEnabledExceptionIfValueSetWhenDisabled() |
88 | 89 | { |
89 | | - await App.DispatcherQueue.EnqueueAsync(async () => |
90 | | - { |
91 | | - const string expectedValue = "Wor"; |
| 90 | + const string expectedValue = "Wor"; |
92 | 91 |
|
93 | | - var tokenizingTextBox = new TokenizingTextBox { IsEnabled = false }; |
| 92 | + var tokenizingTextBox = new TokenizingTextBox { IsEnabled = false }; |
94 | 93 |
|
95 | | - await LoadTestContentAsync(tokenizingTextBox); |
| 94 | + await LoadTestContentAsync(tokenizingTextBox); |
96 | 95 |
|
97 | | - var tokenizingTextBoxAutomationPeer = |
98 | | - FrameworkElementAutomationPeer.CreatePeerForElement(tokenizingTextBox) as TokenizingTextBoxAutomationPeer; |
| 96 | + var tokenizingTextBoxAutomationPeer = |
| 97 | + FrameworkElementAutomationPeer.CreatePeerForElement(tokenizingTextBox) as TokenizingTextBoxAutomationPeer; |
99 | 98 |
|
100 | | - Assert.ThrowsException<ElementNotEnabledException>(() => |
101 | | - { |
102 | | - tokenizingTextBoxAutomationPeer!.SetValue(expectedValue); |
103 | | - }); |
| 99 | + Assert.ThrowsException<ElementNotEnabledException>(() => |
| 100 | + { |
| 101 | + tokenizingTextBoxAutomationPeer!.SetValue(expectedValue); |
104 | 102 | }); |
105 | 103 | } |
106 | 104 |
|
|
0 commit comments