Ejemplo n.º 1
0
        public void Write_WithMultipleStudents_PutsSUMFormulaOnAllScoresOfStudents()
        {
            // Arrange
            var scoreTopPoint    = new Point(1, 0);
            int numberOfStudents = 3;
            var sut = new TotalScoresBlock(
                _startpoint,
                scoreTopPoint,
                numberOfStudents);

            // Act
            sut.Write(_spreadsheetWriter);

            // Assert
            SpreadsheetTestUtilities.PrintArraySpreadsheet(_spreadsheet);
            _spreadsheet[1, 0].Should().Be("StartStandardFormulaSUM");
            _spreadsheet[1, 4].Should().Be("EndStandardFormulaSUM");
            _spreadsheet[1, 5].Should().Be("Result of StandardFormulaSUM");

            _spreadsheet[2, 0].Should().Be("StartStandardFormulaSUM");
            _spreadsheet[2, 4].Should().Be("EndStandardFormulaSUM");
            _spreadsheet[2, 5].Should().Be("Result of StandardFormulaSUM");

            _spreadsheet[3, 0].Should().Be("StartStandardFormulaSUM");
            _spreadsheet[3, 4].Should().Be("EndStandardFormulaSUM");
            _spreadsheet[3, 5].Should().Be("Result of StandardFormulaSUM");

            _spreadsheet[4, 0].Should().Be("StartStandardFormulaSUM");
            _spreadsheet[4, 4].Should().Be("EndStandardFormulaSUM");
            _spreadsheet[4, 5].Should().Be("Result of StandardFormulaSUM");
        }
        private static void AddTotalPointsRow(ISpreadsheetWriter spreadsheetWriter,
                                              Point scorePointTop,
                                              int numberOfStudents)
        {
            var totalPointsBlock = new TotalScoresBlock(
                spreadsheetWriter.CurrentPosition,
                scorePointTop,
                numberOfStudents);

            totalPointsBlock.Write(spreadsheetWriter);
        }
Ejemplo n.º 3
0
        public void Write_WithAssignments_PutsTitleOnRightPosition()
        {
            // Arrange
            var scoreTopPoint    = new Point(1, 0);
            int numberOfStudents = 1;
            var sut = new TotalScoresBlock(
                _startpoint,
                scoreTopPoint,
                numberOfStudents);

            // Act
            sut.Write(_spreadsheetWriter);

            // Assert
            _spreadsheet[0, 5].Should().Be("Totaal");
        }