Esempio n. 1
0
    public void TestCaseFormatColor()
    {
        ColorPresets.Reflash();
        int count = ColorPresets.Count();

        string[] keys = ColorPresets.GetColorKeys();
        if (keys == null)
        {
            return;
        }

        string format  = "[#{0}]asdfsdfsdf111[-]";
        string format2 = "[{0}]asdfsdfsdf111[-]";

        for (int i = 0; i < count; ++i)
        {
            string key   = keys[i];
            string num   = key.Remove(0, ColorPresets.COLOR_PREFIX.Length);
            string value = ColorPresets.GetHexString(key);

            string lhs = ColorPresets.FormatText(string.Format(format, num));
            string rhs = string.Format(format2, value);
            Assert.AreEqual(lhs, rhs);
        }
    }