Beispiel #1
0
        protected JObject PopulateOptions(StylingOption source, bool useDefault = false)
        {
            var target = new JObject();

            source.PopulateOptions(target, useDefault);
            return(target);
        }
Beispiel #2
0
        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");
        }
Beispiel #3
0
        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}");
        }
Beispiel #4
0
 public Style(StylingOption stylingOption, int amount, BreakPoint stylingBreakpoint)
 {
     StylingOption     = stylingOption;
     Amount            = amount;
     StylingBreakpoint = stylingBreakpoint;
 }