Пример #1
0
        public void CssErrorStringsExist()
        {
            var hasFailed = false;

            foreach (var cssErrorName in Enum.GetNames(typeof(CssErrorCode)))
            {
                if (cssErrorName != "NoError")
                {
                    CssErrorCode errorCode;
                    if (Enum.TryParse(cssErrorName, out errorCode))
                    {
                        var message = CssParser.ErrorFormat(errorCode);
                        if (message.IsNullOrWhiteSpace())
                        {
                            Trace.WriteLine(cssErrorName + " has no corresponding error message");
                            hasFailed = true;
                        }
                    }
                    else
                    {
                        Trace.WriteLine(cssErrorName + " failed to parse back into enum");
                        hasFailed = true;
                    }
                }
            }

            Assert.IsFalse(hasFailed);
        }