public void ObjectProperty(string propertyName, Action <JSONObject> propertyValueAction) { propertyName = JSBuilder.Quote(propertyName); jsObject.ObjectProperty(propertyName, (JSObject jsObject) => { propertyValueAction.Invoke(new JSONObject(jsObject)); }); }
public void QuoteWithInternalBacktickQuote() { Assert.AreEqual("\"ab`c\"", JSBuilder.Quote("ab`c")); }
public void QuoteWithInternalDoubleQuote() { Assert.AreEqual("`ab\"c`", JSBuilder.Quote("ab\"c")); }
public void QuoteWithInternalSingleQuote() { Assert.AreEqual("\"ab'c\"", JSBuilder.Quote("ab'c")); }
public void QuoteWithSurroundingBacktickQuotes() { Assert.AreEqual("`abc`", JSBuilder.Quote("`abc`")); }
public void QuoteWithSurroundingDoubleQuotes() { Assert.AreEqual("\"abc\"", JSBuilder.Quote("\"abc\"")); }
public void QuoteWithSurroundingSingleQuotes() { Assert.AreEqual("'abc'", JSBuilder.Quote("'abc'")); }
public void QuoteWithNonEmpty() { Assert.AreEqual("\"abc\"", JSBuilder.Quote("abc")); }
public void QuoteWithEmpty() { Assert.AreEqual("\"\"", JSBuilder.Quote("")); }
public void QuoteWithNull() { Assert.AreEqual("\"\"", JSBuilder.Quote(null)); }
public void BooleanProperty(string propertyName, bool propertyValue) { propertyName = JSBuilder.Quote(propertyName); jsObject.BooleanProperty(propertyName, propertyValue); }
public void StringArrayProperty(string propertyName, IEnumerable <string> arrayElements) { propertyName = JSBuilder.Quote(propertyName); jsObject.QuotedStringArrayProperty(propertyName, arrayElements); }
public void StringProperty(string propertyName, string propertyValue) { propertyName = JSBuilder.Quote(propertyName); propertyValue = JSBuilder.Quote(propertyValue); jsObject.TextProperty(propertyName, propertyValue); }