This commit is contained in:
2026-04-15 22:22:56 -04:00
commit 5906f248f4
90 changed files with 6345 additions and 0 deletions

34
test/src/GameTest.cs Normal file
View File

@@ -0,0 +1,34 @@
namespace ChickenGameTest;
using System.Threading.Tasks;
using Chickensoft.GoDotTest;
using Chickensoft.GodotTestDriver;
using Chickensoft.GodotTestDriver.Drivers;
using Godot;
using Shouldly;
public class GameTest : TestClass
{
private Game _game = default!;
private Fixture _fixture = default!;
public GameTest(Node testScene) : base(testScene) { }
[SetupAll]
public async Task Setup()
{
_fixture = new Fixture(TestScene.GetTree());
_game = await _fixture.LoadAndAddScene<Game>();
}
[CleanupAll]
public void Cleanup() => _fixture.Cleanup();
[Test]
public void TestButtonUpdatesCounter()
{
var buttonDriver = new ButtonDriver(() => _game.TestButton);
buttonDriver.ClickCenter();
_game.ButtonPresses.ShouldBe(1);
}
}