Пример #1
0
        public void GetReportCard_Average()
        {
            // Arrange
            var tracker         = new GraduationTracker();
            var expectedAverage = 95;
            var diploma         = new Diploma
            {
                Id           = 1,
                Credits      = 4,
                Requirements = new int[] { 100, 102, 103, 104 }
            };
            var student = new Student
            {
                Id      = 1,
                Courses = new Course[]
                {
                    new Course {
                        Id = 1, Name = "Math", Mark = 95
                    },
                    new Course {
                        Id = 2, Name = "Science", Mark = 95
                    },
                    new Course {
                        Id = 3, Name = "Literature", Mark = 95
                    },
                    new Course {
                        Id = 4, Name = "Physichal Education", Mark = 95
                    }
                }
            };

            // Act
            var reportCard = tracker.GetReportCard(diploma, student);

            // Assert
            Assert.AreEqual(expectedAverage, reportCard.Average);
        }