[Test] public void ExistsReportsExistenceOfItemMatchCriteria() { var sut = new CopyOnWriteList <T>(Samples); Assert.IsFalse(sut.Exists(b => b.Equals(TestData <T> .M1))); Assert.IsTrue(sut.Exists(b => b.Equals(TestData <T> .Zero))); Assert.IsTrue(sut.Exists(b => b.Equals(TestData <T> .MakeData(SampleSize - 1)))); Assert.IsTrue(sut.Exists(b => b.Equals(TestData <T> .MakeData(SampleSize / 2)))); }
[Test] public void ExistsChokesOnNullMatchCriteria() { var sut = new CopyOnWriteList <T>(); Assert.Catch <ArgumentNullException>(() => sut.Exists(null)); }