Added test base class
This commit is contained in:
Родитель
d1293d05c6
Коммит
7ec42278f6
|
@ -1,8 +1,7 @@
|
|||
using System;
|
||||
using Xunit;
|
||||
[assembly: CollectionBehavior (DisableTestParallelization = true)]
|
||||
namespace HotUI.Tests {
|
||||
public class BindingTests {
|
||||
public class BindingTests : TestBase {
|
||||
|
||||
public class StatePage : View {
|
||||
public readonly State<int> clickCount = new State<int> (1);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
using Xunit;
|
||||
|
||||
namespace HotUI.Tests {
|
||||
public class EnvironmentTests {
|
||||
public class EnvironmentTests : TestBase {
|
||||
|
||||
public class MyBindingObject : BindingObject {
|
||||
public string Foo {
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
using System;
|
||||
using Xunit;
|
||||
|
||||
[assembly: CollectionBehavior (DisableTestParallelization = true)]
|
||||
namespace HotUI.Tests {
|
||||
public class TestBase {
|
||||
public TestBase ()
|
||||
{
|
||||
UI.Init ();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
using System.Threading;
|
||||
|
||||
namespace HotUI.Tests {
|
||||
public static class UI {
|
||||
static bool hasInit;
|
||||
public static void Init ()
|
||||
{
|
||||
if (hasInit)
|
||||
return;
|
||||
hasInit = true;
|
||||
Registrar.Handlers.Register<Button, GenericViewHandler> ();
|
||||
Registrar.Handlers.Register<TextField, GenericViewHandler> ();
|
||||
Registrar.Handlers.Register<Text, GenericViewHandler> ();
|
||||
Registrar.Handlers.Register<Toggle, GenericViewHandler> ();
|
||||
Registrar.Handlers.Register<VStack, GenericViewHandler> ();
|
||||
Registrar.Handlers.Register<HStack, GenericViewHandler> ();
|
||||
Registrar.Handlers.Register<ScrollView, GenericViewHandler> ();
|
||||
Registrar.Handlers.Register<Image, GenericViewHandler> ();
|
||||
Registrar.Handlers.Register<ListView, GenericViewHandler> ();
|
||||
Registrar.Handlers.Register<View, GenericViewHandler> ();
|
||||
Registrar.Handlers.Register<ContentView, GenericViewHandler> ();
|
||||
|
||||
|
||||
Device.PerformInvokeOnMainThread = (a) => a ();
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче