MikeSchulze / gdUnit4Net

A Godot C# Unit Test Framework.
MIT License
61 stars 5 forks source link

GD-110: Allow a Node to be passed in to SceneRunner.Load as the root of the scene. #111

Closed taylor-nightingale closed 5 months ago

taylor-nightingale commented 5 months ago

Why

GD-110

What

Example Usage

Tests can now initialize or use the root node of a scene before it is loaded and any _Ready functions are called on it.

Ex.

public partial class MyNode : Node2d
{ 
    public void Initialize(int foo) { ... }
}

[TestSuite]
public class MyNodeTest  
{ 

    [TestCase]
    public void  MyNodeInitTest()
    {
      var myNode = new MyNode();
      myNode.Initialize(12);
      var sceneRunner = ISceneRunner.Load(myNode);

      ...
    }
}
MikeSchulze commented 5 months ago

hi @taylor-nightingale you want to continue here?

taylor-nightingale commented 5 months ago

hi @taylor-nightingale you want to continue here?

Yes I'll make the required changes. Haven't had time this week for development work.