public void Test_AddCountWrongIncrementsCorrectly() { int before = shieldStateHandler.CountWrong; shieldStateHandler.AddCountWrong(); int afterGetValue = shieldStateHandler.CountWrong; Assert.AreEqual(before + 1, afterGetValue); }
private void FireButtonOnClick() { Debug.Log("Firing!"); if (shieldStateHandler.CountWrong <= 3) { hasFired = false; } if (hasFired || !areGapsFilled) { return; } if (levelHandler.ValidateAnswer()) { audioSource.clip = soundShoot; hintText.text = "Good Job!"; dataHandler.AddRightNum(); FireLasers(); StartCoroutine(TriggerUpdateAfterDelay()); } else { audioSource.clip = soundWrongAnswer; hintText.text = "Wrong Answer!"; shieldStateHandler.AddCountWrong(); Debug.Log("Current wrong times: " + shieldStateHandler.CountWrong); } hasFired = true; audioSource.Play(); }