Beispiel #1
0
        private IFormulaBuilder SetupGradeFormula(ICellRange achievedPoints,
                                                  ICellRange maximumScore,
                                                  ICellRange standardizationFactor,
                                                  ICellRange minimumGrade)
        {
            IFormulaBuilder formulaBuilder = FormulaBuilderFactory.Create();

            return(formulaBuilder
                   .AddEqualsSign()
                   .AddOpenParenthesis()
                   .AddCellAddress(achievedPoints.Address)
                   .AddDivisionSign()
                   .AddConstantSign()
                   .AddCellColumnLetter(maximumScore.Address.ColumnLetter)
                   .AddConstantSign()
                   .AddRowNumber(maximumScore.Address.RowNumber)
                   .AddClosingParenthesis()
                   .AddMultiplicationSign()
                   .AddConstantSign()
                   .AddCellColumnLetter(standardizationFactor.Address.ColumnLetter)
                   .AddConstantSign()
                   .AddRowNumber(standardizationFactor.Address.RowNumber)
                   .AddSummationSign()
                   .AddConstantSign()
                   .AddCellColumnLetter(minimumGrade.Address.ColumnLetter)
                   .AddConstantSign()
                   .AddRowNumber(minimumGrade.Address.RowNumber));
        }
        public void Create_WithInstanceOfFactory_ReturnsInstanceOfForumulaBuilder()
        {
            // Arrange
            var factory = new FormulaBuilderFactory();

            // Act
            IFormulaBuilder result = factory.Create();

            // Assert
            result.Should().BeOfType <EPPlus.Formula.FormulaBuilder>();
        }