Exemple #1
0
        public void TestListMarks_EmptyMarksList_ShouldReturnCorrectString()
        {
            var student = new Student("Gosho", "Peshev", Grade.Ninth);

            var actual = student.ListMarks();
            var expected = "The student has no marks.\r\n";

            Assert.AreEqual(expected, actual);
        }
Exemple #2
0
        public void TestListMarks_ShourdReturnCorrectString()
        {
            var mockedMark = new Mock<IMark>();
            mockedMark.Setup(x => x.Subject).Returns(It.IsAny<Subject>());
            mockedMark.Setup(x => x.Value).Returns(It.IsAny<float>());

            var student = new Student("Gosho", "Peshev", Grade.Ninth);

            student.AddMark(mockedMark.Object);

            var result = student.ListMarks();

            Assert.IsTrue(result.Contains("The student has these marks:"));
        }