public void Exactly() { Assert.ThrowsExact <ArgumentNullException>(() => Assert.Exactly(null as int[], 1, v => v == 0)); Assert.ThrowsExact <ArgumentNullException>(() => Assert.Exactly(new int[] { }, 1, null)); Assert.ThrowsExact <ArgumentException>(() => Assert.Exactly(new int[] { }, 1, v => v == 0)); Assert.ThrowsExact <ArgumentException>(() => Assert.Exactly(new int[] { 0 }, -1, v => v == 0)); Assert.DoesNotThrow(() => Assert.Exactly(new int[] { 1, 2, 3, 4, 5 }, 3, v => v >= 3)); Assert.DoesNotThrow(() => Assert.Exactly(new int[] { 1, 2, 3, 4, 5 }, 5, v => v < 10)); Assert.ThrowsExact <AssertionException>(() => Assert.Exactly(new int[] { 1, 2, 3, 4, 5 }, 4, v => v < 10)); Assert.ThrowsExact <AssertionException>(() => Assert.Exactly(new int[] { 1, 2, 3, 4, 5 }, 6, v => v < 10)); Assert.ThrowsExact <AssertionException>(() => Assert.Exactly(new int[] { 1, 2, 3, 4, 5 }, 5, v => v > 10)); Assert.ThrowsExact <AssertionException>(() => Assert.Exactly(new int[] { 1, 2, 3, 4, 5 }, 5, v => v == 1)); }