public void AccuractyCalculatedCorrectly()
    {
        accuracyCalculator = new AccuracyCalculator(3, 20, 3);
        float a = accuracyCalculator.Accuracy();

        Assert.AreEqual(20.0, a);
    }
    public void AccuracyCalculateNotLessThanZero()
    {
        accuracyCalculator = new AccuracyCalculator(3, 20, -4);
        float a = accuracyCalculator.Accuracy();

        if (a < 0)
        {
            a = 0;
        }
        Assert.AreEqual(0, a);
    }
Exemplo n.º 3
0
    void Update()
    {
        timer         -= Time.deltaTime;
        timerText.text = timer.ToString();
        if (timer < 0)
        {
            PlayerPrefs.SetFloat("accuracy", 0f);
            accuracyCalculator = new AccuracyCalculator(lifespan, totalTime, timeInSquare);
            accuracy           = accuracyCalculator.Accuracy();
            PlayerPrefs.SetFloat("accuracy", accuracy);
            SceneManager.LoadScene("CalibrationOver");
        }

        if (!squareActive)
        {
            slider.value = 0;
            SpawnSquare(counter);
            counter++;
        }
    }