A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

22 lines
496 B

using System;
using Avalonia.Threading;
namespace Avalonia.UnitTests;
public class ScopedTestBase : IDisposable
{
private readonly IDisposable _scope;
public ScopedTestBase()
{
AvaloniaLocator.Current = AvaloniaLocator.CurrentMutable = new AvaloniaLocator();
Dispatcher.ResetBeforeUnitTests();
_scope = AvaloniaLocator.EnterScope();
}
public virtual void Dispose()
{
Dispatcher.ResetForUnitTests();
_scope.Dispose();
}
}