Esempio n. 1
0
        public void CrushTest()
        {
            FormatValidator v1 = new FormatValidator(null);
            Assert.IsNotNull(v1.FormatItems);
            Assert.IsFalse(v1.ContainsFormat);
            Assert.IsTrue(v1.Validate().Result);

            Assert.IsFalse(FormatValidator.IsFormatString(null));
        }
Esempio n. 2
0
 private void ValidateFormat(string format, bool valid = false)
 {
     FormatValidator v1 = new FormatValidator(format);
     Assert.AreEqual(valid, v1.Validate().Result, "'{0}'\n{1}: {2}", format, v1.Validate().ErrorType, v1.Validate().ErrorMessage);
 }
Esempio n. 3
0
 private void ValidateFormatString(string s)
 {
     FormatValidator v = new FormatValidator(s);
     FormatValidateResult result = v.Validate();
     if (!result.Result)
     {
         throw new FormatException(String.Format("Invalid sting format: '{0}'\n{1}", s, result.ErrorMessage));
     }
 }