public void NewCollection_Duplicates() { ReadOnlyContextCollection <string, int> collection = new ReadOnlyContextCollection <string, int> ( delegate(int i) { return(i.ToString()); }, new int[] { 1, 2, 3, 3, 2, 1, 2, 1, 3, 2 }); Assert.That(collection, Is.EquivalentTo(new int[] { 1, 2, 3 })); }
public void SetUp() { _collection = new ReadOnlyContextCollection <string, int> ( delegate(int i) { return(i.ToString()); }, new int[] { 1, 2, 3 }); }
public void Contains_Value() { ReadOnlyContextCollection <string, int> collection = new ReadOnlyContextCollection <string, int> ( delegate(int i) { if (i > 2) { return(">2"); } else { return(i.ToString()); } }, new int[] { 1, 2, 3 }); Assert.That(collection.Contains(1), Is.True); Assert.That(collection.Contains(2), Is.True); Assert.That(collection.Contains(3), Is.True); Assert.That(collection.Contains(4), Is.False); }