public void IncorrectSourceCollectionCountTest() { Assert.Throws <ArgumentException>( () => PersistentList <int> .OfReadonly(new DeficientCollection())); Assert.Throws <ArgumentOutOfRangeException>( () => PersistentList <int> .OfReadonly(new NegativeCountCollection())); }
public void CreateListTest() { const int maxLength = 100; for (int i = 0; i < maxLength; i++) { int[] collection = Enumerable.Range(0, i).ToArray(); CheckListEquality(collection, PersistentList <int> .Of(collection)); CheckListEquality(collection, PersistentList <int> .OfReadonly(collection)); } }