fix(dock): move dock math to core to fix test suite breakage
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Ghost.Editor.View.Controls;
|
||||
using Ghost.Editor.Core.Controls.Internal.Docking;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace Ghost.UnitTest;
|
||||
@@ -12,36 +12,36 @@ public class DockLayoutTest
|
||||
public void TestCalculateDockPosition_Center()
|
||||
{
|
||||
// 100x100, threshold 0.25 -> Center is [25, 75]
|
||||
var pos = DockLayout.CalculateDockPosition(100, 100, 50, 50, THRESHOLD);
|
||||
Assert.AreEqual(DockLayout.DockPosition.Center, pos);
|
||||
var pos = DockMath.CalculateDockPosition(100, 100, 50, 50, THRESHOLD);
|
||||
Assert.AreEqual(DockPosition.Center, pos);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestCalculateDockPosition_Left()
|
||||
{
|
||||
var pos = DockLayout.CalculateDockPosition(100, 100, 10, 50, THRESHOLD);
|
||||
Assert.AreEqual(DockLayout.DockPosition.Left, pos);
|
||||
var pos = DockMath.CalculateDockPosition(100, 100, 10, 50, THRESHOLD);
|
||||
Assert.AreEqual(DockPosition.Left, pos);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestCalculateDockPosition_Right()
|
||||
{
|
||||
var pos = DockLayout.CalculateDockPosition(100, 100, 90, 50, THRESHOLD);
|
||||
Assert.AreEqual(DockLayout.DockPosition.Right, pos);
|
||||
var pos = DockMath.CalculateDockPosition(100, 100, 90, 50, THRESHOLD);
|
||||
Assert.AreEqual(DockPosition.Right, pos);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestCalculateDockPosition_Top()
|
||||
{
|
||||
var pos = DockLayout.CalculateDockPosition(100, 100, 50, 10, THRESHOLD);
|
||||
Assert.AreEqual(DockLayout.DockPosition.Top, pos);
|
||||
var pos = DockMath.CalculateDockPosition(100, 100, 50, 10, THRESHOLD);
|
||||
Assert.AreEqual(DockPosition.Top, pos);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestCalculateDockPosition_Bottom()
|
||||
{
|
||||
var pos = DockLayout.CalculateDockPosition(100, 100, 50, 90, THRESHOLD);
|
||||
Assert.AreEqual(DockLayout.DockPosition.Bottom, pos);
|
||||
var pos = DockMath.CalculateDockPosition(100, 100, 50, 90, THRESHOLD);
|
||||
Assert.AreEqual(DockPosition.Bottom, pos);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@@ -49,14 +49,14 @@ public class DockLayoutTest
|
||||
{
|
||||
// (10, 10) is in both Left and Top zones.
|
||||
// Current implementation: Left/Right win over Top/Bottom.
|
||||
var pos = DockLayout.CalculateDockPosition(100, 100, 10, 10, THRESHOLD);
|
||||
Assert.AreEqual(DockLayout.DockPosition.Left, pos);
|
||||
var pos = DockMath.CalculateDockPosition(100, 100, 10, 10, THRESHOLD);
|
||||
Assert.AreEqual(DockPosition.Left, pos);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestCalculateDockPosition_CornerPrecedence_RightBottom()
|
||||
{
|
||||
var pos = DockLayout.CalculateDockPosition(100, 100, 90, 90, THRESHOLD);
|
||||
Assert.AreEqual(DockLayout.DockPosition.Right, pos);
|
||||
var pos = DockMath.CalculateDockPosition(100, 100, 90, 90, THRESHOLD);
|
||||
Assert.AreEqual(DockPosition.Right, pos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Editor\Ghost.Editor.Core\Ghost.Editor.Core.csproj" />
|
||||
<ProjectReference Include="..\..\Editor\Ghost.Editor\Ghost.Editor.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user