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); }
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); }
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); }
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); }
public void UpdateFormulaReferencesIgnoresIncorrectSheet() { var formulaManager = new FormulaManager(); var result = formulaManager.UpdateFormulaReferences("C3", 3, 3, 2, 2, "sheet", "other sheet"); Assert.AreEqual("C3", result); }
public void UpdateFormulaReferencesOnTheSameSheet() { var formulaManager = new FormulaManager(); var result = formulaManager.UpdateFormulaReferences("C3", 3, 3, 2, 2, "sheet", "sheet"); Assert.AreEqual("F6", result); }
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")); }