示例#1
0
        public void TwoTotalCorrectdWhenTwoCorrect()
        {
            // Arrange
            QuizManager qm             = new QuizManager();
            int         expectedResult = 2;

            qm.AddOneToCorrectTotal();
            qm.AddOneToCorrectTotal();

            // Act
            int result = qm.GetTotalQuestionsCorrect();

            // Assert
            Assert.AreEqual(expectedResult, result);
        }
示例#2
0
        public void OneHundredPercentageCorrectWhenOneCorrectZeroWrong()
        {
            // Arrange
            QuizManager qm             = new QuizManager();
            int         expectedResult = 100;

            qm.AddOneToCorrectTotal();

            // Act
            int result = qm.GetPercentageQuestionsCorrect();

            // Assert
            Assert.AreEqual(expectedResult, result);
        }
示例#3
0
        public void TwoTotalAttemptedWhenOneCorrectOneWrong()
        {
            // Arrange
            QuizManager qm             = new QuizManager();
            int         expectedResult = 2;

            qm.AddOneToCorrectTotal();
            qm.AddOneToWrongTotal();

            // Act
            int result = qm.GetTotalQuestionsAttempted();

            // Assert
            Assert.AreEqual(expectedResult, result);
        }
示例#4
0
        public void TwentyFivePercentageCorrectWhenOneCorrectThreeWrong()
        {
            // Arrange
            QuizManager qm             = new QuizManager();
            int         expectedResult = 25;

            qm.AddOneToCorrectTotal();
            qm.AddOneToWrongTotal();
            qm.AddOneToWrongTotal();
            qm.AddOneToWrongTotal();

            // Act
            int result = qm.GetPercentageQuestionsCorrect();

            // Assert
            Assert.AreEqual(expectedResult, result);
        }