public void RegexTest() { string actual = "1~~5~~4"; string actual2 = "a~~b~~c"; string pattern = "[0-9]~~[0-9]~~[0-9]"; SAssert.IsMatch(actual, pattern); XAssert.Throws <ArgumentException>(() => SAssert.IsMatch(actual2, pattern)); }