60 lines
1.5 KiB
C#
60 lines
1.5 KiB
C#
|
using System;
|
||
|
using Godot;
|
||
|
using GodotComponentTest.utils;
|
||
|
using GoDotTest;
|
||
|
using Xunit;
|
||
|
|
||
|
namespace GodotComponentTest.tests;
|
||
|
|
||
|
public class StreamContainerTests : TestClass
|
||
|
{
|
||
|
private Node _testScene = null;
|
||
|
private TileWorld _tileWorld;
|
||
|
private StreamContainer _streamContainer;
|
||
|
|
||
|
private PackedScene _tileWorldScene = GD.Load<PackedScene>("res://scenes/TileWorld.tscn");
|
||
|
private PackedScene _streamContainerScene = GD.Load<PackedScene>("res://scenes/StreamContainer.tscn");
|
||
|
|
||
|
public StreamContainerTests(Node testScene) : base(testScene)
|
||
|
{
|
||
|
_testScene = testScene;
|
||
|
}
|
||
|
|
||
|
[Setup]
|
||
|
public void Setup()
|
||
|
{
|
||
|
_tileWorld = (TileWorld) _tileWorldScene.Instance();
|
||
|
_tileWorld.HexGrid = new HexGrid();
|
||
|
_testScene.AddChild(_tileWorld);
|
||
|
_streamContainer = (StreamContainer) _streamContainerScene.Instance();
|
||
|
|
||
|
foreach (Node node in _testScene.GetChildren())
|
||
|
{
|
||
|
if (node is TileWorld)
|
||
|
{
|
||
|
_streamContainer.World = node.GetPath();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
_testScene.AddChild(_streamContainer);
|
||
|
}
|
||
|
|
||
|
[Cleanup]
|
||
|
public void Cleanup()
|
||
|
{
|
||
|
foreach (Node node in _testScene.GetChildren())
|
||
|
{
|
||
|
node.QueueFree();
|
||
|
}
|
||
|
|
||
|
_streamContainer.QueueFree();
|
||
|
_tileWorld.QueueFree();
|
||
|
}
|
||
|
|
||
|
[Test]
|
||
|
public void Plane2DDistSimple()
|
||
|
{
|
||
|
// _streamContainer.UpdateRects(new Vector2(0, 0));
|
||
|
// _streamContainer.UpdateRects(new Vector2(1, 0));
|
||
|
}
|
||
|
}
|