mirror of
https://git.tonybark.com/tonytins/CyberBits.git
synced 2026-05-12 05:23:34 -04:00
Initial migration to the new 2dog project project structure
This commit is contained in:
parent
55044ae4b8
commit
1f2032dcf8
34 changed files with 830 additions and 96 deletions
52
CyberBits.Tests/BasicTests.cs
Normal file
52
CyberBits.Tests/BasicTests.cs
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
using Godot;
|
||||
using twodog.xunit;
|
||||
|
||||
namespace CyberBits.Tests;
|
||||
|
||||
[Collection("GodotHeadless")]
|
||||
public class BasicTests(GodotHeadlessFixture godot)
|
||||
{
|
||||
[Fact]
|
||||
public void LoadMainScene_Succeeds()
|
||||
{
|
||||
// Arrange
|
||||
var scene = GD.Load<PackedScene>("res://main.tscn");
|
||||
|
||||
// Act
|
||||
var instance = scene.Instantiate();
|
||||
godot.Tree.Root.AddChild(instance);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(instance);
|
||||
Assert.NotNull(instance.GetParent());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PhysicsIteration_Succeeds()
|
||||
{
|
||||
// Arrange & Act
|
||||
godot.Tree.Root.PhysicsInterpolationMode = Node.PhysicsInterpolationModeEnum.Off;
|
||||
godot.GodotInstance.Iteration();
|
||||
|
||||
// Assert - if we get here without crashing, test passes
|
||||
Assert.True(true);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CreateNode_AddsToTree()
|
||||
{
|
||||
// Arrange
|
||||
var node = new Node();
|
||||
node.Name = "TestNode";
|
||||
|
||||
// Act
|
||||
godot.Tree.Root.AddChild(node);
|
||||
|
||||
// Assert
|
||||
Assert.True(godot.Tree.Root.HasNode("TestNode"));
|
||||
Assert.Equal("TestNode", (string)godot.Tree.Root.GetNode("TestNode").Name);
|
||||
|
||||
// Cleanup
|
||||
node.QueueFree();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue