Skip to content

Instantly share code, notes, and snippets.

@aallbrig
Created February 19, 2022 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aallbrig/1147f75d827fd151f2b2ba040baa2792 to your computer and use it in GitHub Desktop.
Save aallbrig/1147f75d827fd151f2b2ba040baa2792 to your computer and use it in GitHub Desktop.
public class MainMenuMonoBehaviourUnitTests
{
[UnityTest]
public IEnumerator MainMenu_CanStartGame()
{
var called = false;
var sut = new GameObject().AddComponent<MainMenu>();
sut.Interactions = new SpyMainMenuInteractions {OnStartGame = () => called = true};
yield return new WaitForEndOfFrame();
sut.StartGame();
Assert.IsTrue(called);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment