コード例 #1
0
        public void IsMatch()
        {
            Assert.ThrowsExact <ArgumentNullException>(() => Assert.IsMatch(null as Regex, string.Empty));
            Assert.ThrowsExact <ArgumentNullException>(() => Assert.IsMatch(new Regex(string.Empty), null));

            Assert.ThrowsExact <AssertionException>(() => Assert.IsMatch("abc", "cba"));
            Assert.ThrowsExact <AssertionException>(() => Assert.IsMatch(new Regex("abc"), "cba"));
            Assert.DoesNotThrow(() => Assert.IsMatch("abc", "abc"));
            Assert.DoesNotThrow(() => Assert.IsMatch(new Regex("abc"), "abc"));
        }