public void EncodeValues() { // only quote the value when it is a string (no type specified or type equals zero) bool quote = (this.Type.Value == null || this.Type.Value == "0"); this.Value = CellValueLiteral.EncodeValue(this.Value.Value, quote); this.Label = CellValueLiteral.EncodeValue(this.Label.Value); this.Format = CellValueLiteral.EncodeValue(this.Format.Value); this.Prompt = CellValueLiteral.EncodeValue(this.Prompt.Value); }
public void CellValueLiteral_EncodeValue() { Assert.AreEqual(null, CellValueLiteral.EncodeValue(null)); Assert.AreEqual("", CellValueLiteral.EncodeValue("")); Assert.AreEqual("=1", CellValueLiteral.EncodeValue("=1")); Assert.AreEqual("\"A\"", CellValueLiteral.EncodeValue("\"A\"")); Assert.AreEqual("\"A\"", CellValueLiteral.EncodeValue("A")); Assert.AreEqual("\"A\"\"", CellValueLiteral.EncodeValue("\"A\"\"")); Assert.AreEqual("\"A\"\"\"", CellValueLiteral.EncodeValue("A\"")); Assert.AreEqual(null, CellValueLiteral.EncodeValue(null, false)); Assert.AreEqual("", CellValueLiteral.EncodeValue("", false)); Assert.AreEqual("=1", CellValueLiteral.EncodeValue("=1", false)); Assert.AreEqual("\"A\"", CellValueLiteral.EncodeValue("\"A\"", false)); Assert.AreEqual("A", CellValueLiteral.EncodeValue("A", false)); Assert.AreEqual("\"A\"\"", CellValueLiteral.EncodeValue("\"A\"\"", false)); Assert.AreEqual("A\"", CellValueLiteral.EncodeValue("A\"", false)); }
public void EncodeValues() { this.Value = CellValueLiteral.EncodeValue(this.Value.Value); this.Prompt = CellValueLiteral.EncodeValue(this.Prompt.Value); }