diff --git a/tests/Avalonia.RenderTests/Shapes/ShapeTests.cs b/tests/Avalonia.Layout.UnitTests/ShapeLayoutTests.cs similarity index 91% rename from tests/Avalonia.RenderTests/Shapes/ShapeTests.cs rename to tests/Avalonia.Layout.UnitTests/ShapeLayoutTests.cs index 20d3af375c..2ccd6fb04c 100644 --- a/tests/Avalonia.RenderTests/Shapes/ShapeTests.cs +++ b/tests/Avalonia.Layout.UnitTests/ShapeLayoutTests.cs @@ -2,20 +2,21 @@ using Avalonia.Controls; using Avalonia.Controls.Shapes; using Avalonia.Media; +using Avalonia.Platform; +using Avalonia.UnitTests; using Xunit; +namespace Avalonia.Layout.UnitTests -#if AVALONIA_SKIA -namespace Avalonia.Skia.RenderTests -#else -namespace Avalonia.Direct2D1.RenderTests.Shapes -#endif { - public class ShapeTests : TestBase + public class ShapeLayoutTests : TestWithServicesBase { - public ShapeTests() - : base(@"Shapes\Shape") - { } + + public ShapeLayoutTests() + { + AvaloniaLocator.CurrentMutable + .Bind().ToSingleton(); + } [Fact] public void Shape_Transformation_Calculation_Should_Be_Deferred_To_Arrange_When_Strech_Is_Fill_And_Aviable_Size_Is_Infinite() diff --git a/tests/Avalonia.RenderTests/Avalonia.RenderTests.projitems b/tests/Avalonia.RenderTests/Avalonia.RenderTests.projitems index 4263d7b206..ff729a6b48 100644 --- a/tests/Avalonia.RenderTests/Avalonia.RenderTests.projitems +++ b/tests/Avalonia.RenderTests/Avalonia.RenderTests.projitems @@ -14,7 +14,6 @@ - diff --git a/tests/Avalonia.UnitTests/TestWithServicesBase.cs b/tests/Avalonia.UnitTests/TestWithServicesBase.cs new file mode 100644 index 0000000000..bbd6c7427c --- /dev/null +++ b/tests/Avalonia.UnitTests/TestWithServicesBase.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Avalonia.UnitTests +{ + public class TestWithServicesBase : IDisposable + { + private IDisposable _scope; + + public TestWithServicesBase() + { + _scope = AvaloniaLocator.EnterScope(); + } + + public void Dispose() + { + _scope.Dispose(); + } + } +}