public void ShowCorrectly() { // Arrange builderInWorldLoadingView.gameObject.SetActive(false); builderInWorldLoadingView.currentTipIndex = -1; builderInWorldLoadingView.tipsCoroutine = null; // Act builderInWorldLoadingView.Show(); // Assert Assert.IsTrue(builderInWorldLoadingView.gameObject.activeSelf, "The view activeSelf property is false!"); if (builderInWorldLoadingView.loadingTips.Count > 0) { Assert.IsTrue(builderInWorldLoadingView.currentTipIndex >= 0, "currentTipIndex is less than 0!"); Assert.NotNull(builderInWorldLoadingView.tipsCoroutine, "tipsCoroutine is null!"); } }
public void ShowCorrectly(bool showTips) { // Arrange builderInWorldLoadingView.gameObject.SetActive(false); builderInWorldLoadingView.tipsText.text = string.Empty; // Act builderInWorldLoadingView.Show(showTips); // Assert Assert.IsTrue(builderInWorldLoadingView.gameObject.activeSelf, "The view activeSelf property is false!"); if (showTips && builderInWorldLoadingView.loadingTips.Count > 0) { Assert.IsNotEmpty(builderInWorldLoadingView.tipsText.text, "tipsText is empty!"); Assert.IsTrue(builderInWorldLoadingView.loadingTips.Contains(builderInWorldLoadingView.tipsText.text), "The set tipsText does not match!"); } else { Assert.IsEmpty(builderInWorldLoadingView.tipsText.text, "tipsText is not empty!"); } }