1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-24 04:04:34 +00:00
Files
mobile/src/UiTests/Setup/PlatformQuery.cs
2022-04-05 00:35:48 +01:00

39 lines
879 B
C#
Executable File

using System;
using Xamarin.UITest;
using Xamarin.UITest.Queries;
namespace Bit.UITests.Setup
{
public class PlatformQuery
{
Func<AppQuery, AppQuery> _current;
public Func<AppQuery, AppQuery> Current
{
get
{
if (_current == null)
throw new NullReferenceException("Trait not set for current platform");
return _current;
}
}
public Func<AppQuery, AppQuery> Android
{
set
{
if (AppManager.Platform == Platform.Android)
_current = value;
}
}
public Func<AppQuery, AppQuery> iOS
{
set
{
if (AppManager.Platform == Platform.iOS)
_current = value;
}
}
}
}