[Test] public void AddRangeIfAbsentNopOnEmptyCollection() { var sut = new CopyOnWriteList <T>(Samples); sut.AddRangeAbsent(new T[0]); Assert.That(sut.Count, Is.EqualTo(SampleSize)); }
[Test] public void AddRangeIfAbsentAddOnlyThoseNotExist() { var sut = new CopyOnWriteList <T>(Samples); var c = new[] { TestData <T> .M1, TestData <T> .M2, TestData <T> .One, // Will no add. }; Assert.That(sut.AddRangeAbsent(c), Is.EqualTo(2)); Assert.That(sut.Count, Is.EqualTo(SampleSize + 2)); Assert.IsTrue(sut.Contains(TestData <T> .M1)); Assert.IsTrue(sut.Contains(TestData <T> .M2)); }