protected JObject PopulateOptions(StylingOption source, bool useDefault = false) { var target = new JObject(); source.PopulateOptions(target, useDefault); return(target); }
public void TestPopulation() { var so = new JObject(); StylingOption.PopulateJObject(new CSSBorder("1px solid red"), so); Assert.AreEqual(0, so.Count, "Somehow options were populated from a CSSBorder"); var r = new Random(); var options = new WebChatStyleOptions(); PopulateOptions(r, options); so = new JObject(); StylingOption.PopulateJObject(options, so); Assert.AreNotEqual(0, so.Count, "No options were populated"); }
public void OptionNames() { var r = new Random(); var options = new WebChatStyleOptions(); PopulateOptions(r, options); var so = StylingOption.GetOptionNames(options); var p = GetRelativeFileName("OptionNames.txt"); var expected = File.ReadAllLines(p).ToList(); var missing = expected.Except(so).ToList(); var missingNames = String.Empty; if (missing.Count > 0) { missingNames = String.Join(',', missing); } Assert.AreEqual(0, missing.Count, $"{missing.Count} name(s) are missing from WebChatOptions\n{missingNames}"); }
public Style(StylingOption stylingOption, int amount, BreakPoint stylingBreakpoint) { StylingOption = stylingOption; Amount = amount; StylingBreakpoint = stylingBreakpoint; }