Пример #1
0
        public void VerifierReponseTest()
        {
            // Création d’un test
            List <string> reponsesTest = new List <string> {
                "31221", "31322", "32131"
            };
            TestAttentionConcentration target = new TestAttentionConcentration(reponsesTest);

            // Paramètres
            string reponse     = "3";
            int    numQuestion = 2;

            // Réel et attendu
            List <string> expected = new List <string> {
                "2", "3"
            };
            List <string> actual = target.VerifierReponse(reponse, numQuestion);

            // Vérifications
            Assert.AreEqual(expected.Count, actual.Count);
            for (int i = 0; i < actual.Count; i++)
            {
                Assert.AreEqual(expected[i], actual[i]);
            }
        }
Пример #2
0
        public void CalculerResultatTest()
        {
            // Création d’un test
            List <string> reponsesTest = new List <string> {
                "31221", "31322", "32131"
            };
            TestAttentionConcentration target = new TestAttentionConcentration(reponsesTest);

            // Paramètres
            target.VerifierReponse("3", 0);
            target.VerifierReponse("1", 1);
            target.VerifierReponse("3", 2);
            target.VerifierReponse("2", 3);
            target.VerifierReponse("1", 4);

            target.VerifierReponse("3", 5);
            target.VerifierReponse("2", 6);
            target.VerifierReponse("3", 7);
            target.VerifierReponse("1", 8);
            target.VerifierReponse("2", 9);

            target.VerifierReponse("3", 10);
            target.VerifierReponse("3", 11);
            target.VerifierReponse("1", 12);
            target.VerifierReponse("3", 13);
            target.VerifierReponse("1", 14);

            // Réel et attendu
            double expected = 73.33;
            double actual   = target.CalculerResultat();

            // Vérification
            Assert.AreEqual(expected, actual);
        }