Maui.UITesting/tests/RemoteAutomationTests/UnitTest1.cs

31 строка
752 B
C#
Исходник Постоянная ссылка Обычный вид История

2021-12-24 22:10:25 +03:00
using Microsoft.Maui.Automation;
using System.Collections.Generic;
2021-12-24 22:10:25 +03:00
using System.Net;
using System.Threading.Tasks;
using Xunit;
namespace RemoteAutomationTests
{
public class UnitTest1
{
[Fact]
2021-12-28 23:28:02 +03:00
public async Task ListWindowsTest()
2021-12-24 22:10:25 +03:00
{
// Build a mock app
var app = new MockApplication()
2021-12-28 01:48:24 +03:00
.WithWindow("window1", "Window", "Window Title")
.WithView("view1");
2022-09-03 04:12:37 +03:00
var windows = new List<Element>();
2022-09-09 00:10:33 +03:00
var elems = await app.GetElements();
2021-12-24 22:10:25 +03:00
// Query the remote host
2022-09-03 04:12:37 +03:00
foreach (var window in elems)
{
windows.Add(window);
}
2021-12-24 22:10:25 +03:00
Assert.NotEmpty(windows);
}
}
}