Esempio n. 1
0
        private void btnGrade_Click(object sender, EventArgs e)
        {
            Student nyStudent = new Student(textBoxStudent.Text);

            myExam.Assign(nyStudent);
            myExam.Grade(nyStudent, comboBoxGrade.SelectedItem.ToString());
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Student student = new Student(textBox1.Text);

            anExam.Assign(student);
            comboBox1.Items.Add(student);
        }
Esempio n. 3
0
        public void Statistics()
        {
            var sut    = new Exam("CSharp");
            var alice  = new Student("Alice");
            var bob    = new Student("Bob");
            var caesar = new Student("Caesar");

            sut.Assign(alice);
            sut.Assign(bob);
            sut.Assign(caesar);
            sut.Grade(alice, "G");
            sut.Grade(bob, "VG");
            sut.Grade(caesar, "G");
            Dictionary <string, int> statistics = sut.GenerateStatistics();

            Assert.AreEqual(statistics["IG"], 0);
            Assert.AreEqual(statistics["G"], 2);
            Assert.AreEqual(statistics["VG"], 1);
        }