示例#1
0
        public void UpdateFormulaReferencesReferencingADifferentSheetIsNotUpdated()
        {
            var formulaManager = new FormulaManager();
            var result         = formulaManager.UpdateFormulaReferences("'boring sheet'!C3", 3, 3, 2, 2, "boring sheet", "updated sheet");

            Assert.AreEqual("'boring sheet'!C3", result);
        }
示例#2
0
        public void UpdateFormulaReferencesFullyQualifiedReferenceOnADifferentSheet()
        {
            var formulaManager = new FormulaManager();
            var result         = formulaManager.UpdateFormulaReferences("'updated sheet'!C3", 3, 3, 2, 2, "boring sheet", "updated sheet");

            Assert.AreEqual("'updated sheet'!F6", result);
        }
示例#3
0
        public void UpdateFormulaReferencesFullyQualifiedCrossSheetReferenceArray()
        {
            var formulaManager = new FormulaManager();
            var result         = formulaManager.UpdateFormulaReferences("SUM('sheet name here'!B2:D4)", 3, 3, 3, 3, "cross sheet", "sheet name here");

            Assert.AreEqual("SUM('sheet name here'!B2:G7)", result);
        }
示例#4
0
        public void UpdateFormulaReferencesFullyQualifiedReferenceOnTheSameSheet()
        {
            var formulaManager = new FormulaManager();
            var result         = formulaManager.UpdateFormulaReferences("'sheet name here'!C3", 3, 3, 2, 2, "sheet name here", "sheet name here");

            Assert.AreEqual("'sheet name here'!F6", result);
        }
示例#5
0
        public void UpdateFormulaReferencesIgnoresIncorrectSheet()
        {
            var formulaManager = new FormulaManager();
            var result         = formulaManager.UpdateFormulaReferences("C3", 3, 3, 2, 2, "sheet", "other sheet");

            Assert.AreEqual("C3", result);
        }
示例#6
0
        public void UpdateFormulaReferencesOnTheSameSheet()
        {
            var formulaManager = new FormulaManager();
            var result         = formulaManager.UpdateFormulaReferences("C3", 3, 3, 2, 2, "sheet", "sheet");

            Assert.AreEqual("F6", result);
        }
示例#7
0
        public void UpdateFormulaReferencesPreservesEscapedQuotes()
        {
            var formulaManager = new FormulaManager();

            Assert.AreEqual("\"Hello,\"\" World\"&\"!\"", formulaManager.UpdateFormulaReferences("\"Hello,\"\" World\"&\"!\"", 1, 1, 8, 2, "Sheet", "Sheet"));
            Assert.AreEqual("FUNCTION(1,\"Hello World\",\"My name is \"\"Bob\"\"\",16)", formulaManager.UpdateFormulaReferences("FUNCTION(1, \"Hello World\", \"My name is \"\"Bob\"\"\", 16)", 1, 1, 8, 2, "Sheet", "Sheet"));
            Assert.AreEqual("FUNCTION(\"This is an example of \"\" Nested \"\"\"\" Quotes \"\".\")", formulaManager.UpdateFormulaReferences("FUNCTION(\"This is an example of \"\" Nested \"\"\"\" Quotes \"\".\")", 1, 1, 8, 2, "Sheet", "Sheet"));
        }