コード例 #1
0
 public void DoesNotContain()
 {
     Assert.ThrowsExact <ArgumentNullException>(() => Assert.DoesNotContain <int>(null, 1));
     Assert.ThrowsExact <ArgumentNullException>(() => Assert.DoesNotContain("ABC", 'c', null as IEqualityComparer <char>));
     Assert.ThrowsExact <ArgumentException>(() => Assert.DoesNotContain <int>(new int[] { }, 1));
     Assert.DoesNotThrow(() => Assert.DoesNotContain(new int[] { 2 }, 1));
     Assert.ThrowsExact <AssertionException>(() => Assert.DoesNotContain(new int[] { 2 }, 2));
     Assert.DoesNotThrow(() => Assert.DoesNotContain("ABC", 'd', new CharCaseInvariantComparer()));
     Assert.ThrowsExact <AssertionException>(() => Assert.DoesNotContain("ABC", 'c', new CharCaseInvariantComparer()));
 }