Skip to content

test(NetworkManagerHUD): add unit test#4109

Draft
Nietod wants to merge 1 commit intoMirrorNetworking:masterfrom
Nietod:TestNetworkManagerHUD
Draft

test(NetworkManagerHUD): add unit test#4109
Nietod wants to merge 1 commit intoMirrorNetworking:masterfrom
Nietod:TestNetworkManagerHUD

Conversation

@Nietod
Copy link
Copy Markdown
Contributor

@Nietod Nietod commented Apr 24, 2026

Added unit tests for the NetworkManagersHUDs lifecycle and attributes.

Not sure about the OnGUI Methods. Found some workaround by using delegates but could be overengineered and not suitable.

// NetworkManagerHUD
internal Func<string, GUILayoutOption[], bool> button = GUILayout.Button;

internal void OnGUI()
{
  if (button("Host", null))
  {
    //Methods...
  }
}

// NetworkManagerHUDTest
hud.button = (label, options) => true;
hud.OnGUI();

hud.button = (label, options) => false;
hud.OnGUI();

Guess can't really do OnGUI within EditModeTests.

Making this one Draft until clear instructions on how to handle OnGUI.

Added unit test for the NetworkManagersHUDs lifecycle and attributes.

Not sure about the OnGUI Methods. Found some workaround by using delegates but could be overengineered and not suitable.
@Nietod Nietod marked this pull request as draft April 24, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant