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/61ce9c12cf184a559e243fc951a3218c to your computer and use it in GitHub Desktop.
Save aallbrig/61ce9c12cf184a559e243fc951a3218c to your computer and use it in GitHub Desktop.
public class LevelOneTests
{
private const string TargetScene = "Level One";
public static string[] ExpectedGameElements =
{
"Player"
};
private GameObject FindGameObjectByName(string name) => GameObject.Find(name);
[UnityTest]
public IEnumerator TheSceneFeaturesTheseElements(
[ValueSource(nameof(ExpectedGameElements))]
string gameObjectName
)
{
Scene sut;
yield return SceneLoader.LoadTargetScene(TargetScene, scene => sut = scene);
Assert.NotNull(GameObject.Find(gameObjectName));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment