2021-08-11 11:06:46 +03:00
|
|
|
#if !__WATCHOS__
|
2016-08-03 20:12:07 +03:00
|
|
|
|
|
|
|
using System;
|
|
|
|
using Foundation;
|
|
|
|
using SpriteKit;
|
|
|
|
using NUnit.Framework;
|
2022-02-14 20:50:23 +03:00
|
|
|
#if NET
|
|
|
|
using System.Numerics;
|
|
|
|
#else
|
|
|
|
using OpenTK;
|
|
|
|
#endif
|
2016-08-03 20:12:07 +03:00
|
|
|
|
2022-11-10 19:59:26 +03:00
|
|
|
namespace MonoTouchFixtures.SpriteKit {
|
2016-08-03 20:12:07 +03:00
|
|
|
[TestFixture]
|
|
|
|
[Preserve (AllMembers = true)]
|
2022-11-10 19:59:26 +03:00
|
|
|
public class WarpGeometryGridTest {
|
2016-08-03 20:12:07 +03:00
|
|
|
Vector2 [] points = new Vector2 [] {
|
|
|
|
new Vector2 (0,0), new Vector2 (0,1), new Vector2 (0,2), new Vector2 (0,3),
|
|
|
|
new Vector2 (1,3), new Vector2 (1,2), new Vector2 (1,1), new Vector2 (1,0)
|
|
|
|
};
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void SKWarpGeometryGridTest ()
|
|
|
|
{
|
|
|
|
TestRuntime.AssertXcodeVersion (8, 0);
|
|
|
|
|
|
|
|
var grid = new SKWarpGeometryGrid (1, 1, points, points);
|
|
|
|
Assert.NotNull (grid, "new SKWarpGeometryGrid () should not return null");
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void CreateTest ()
|
|
|
|
{
|
|
|
|
TestRuntime.AssertXcodeVersion (8, 0);
|
|
|
|
|
|
|
|
var grid = SKWarpGeometryGrid.Create (1, 1, points, points);
|
|
|
|
Assert.NotNull (grid, "SKWarpGeometryGrid.Create should not return null");
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetGridByReplacingSourcePositionsTest ()
|
|
|
|
{
|
|
|
|
TestRuntime.AssertXcodeVersion (8, 0);
|
|
|
|
|
|
|
|
using (var grid = SKWarpGeometryGrid.GetGrid ()) {
|
|
|
|
var r = grid.GetGridByReplacingSourcePositions (points);
|
|
|
|
Assert.NotNull (r, "GetGridByReplacingSourcePositions should not return null");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetGridByReplacingDestPositionsTest ()
|
|
|
|
{
|
|
|
|
TestRuntime.AssertXcodeVersion (8, 0);
|
|
|
|
|
|
|
|
using (var grid = SKWarpGeometryGrid.GetGrid ()) {
|
|
|
|
var r = grid.GetGridByReplacingDestPositions (points);
|
|
|
|
Assert.NotNull (r, "GetGridByReplacingDestPositions should not return null");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-11 11:06:46 +03:00
|
|
|
#endif // !__WATCHOS__
|