public void CancelLoadingCorrectly() { // Arrange bool loadingCanceled = false; builderInWorldLoadingView.OnCancelLoading += () => { loadingCanceled = true; }; // Act builderInWorldLoadingView.CancelLoading(new DCLAction_Trigger()); // Assert Assert.IsTrue(loadingCanceled, "loadingCanceled is false!"); }
public void CancelLoadingCorrectly() { // Arrange builderInWorldLoadingView.gameObject.SetActive(true); bool loadingCanceled = false; builderInWorldLoadingView.OnCancelLoading += () => { loadingCanceled = true; }; // Act builderInWorldLoadingView.CancelLoading(); // Assert Assert.IsFalse(builderInWorldLoadingView.gameObject.activeSelf, "The view activeSelf property is true!"); Assert.IsTrue(loadingCanceled, "loadingCanceled is false!"); }