public void AsEnumerable_NonEmptyCollectionShouldReturnNonEmptyResult()
        {
            var collection = new StringCollection {
                "foo", "bar"
            };

            Assert.That(collection.AsEnumerable().Count(), Is.EqualTo(2));
            Assert.That(collection.AsEnumerable().First(), Is.EqualTo("foo"));
            Assert.That(collection.AsEnumerable().Last(), Is.EqualTo("bar"));
        }
        public void AsEnumerable_ShouldHandleNullCollection()
        {
            StringCollection testCollection = null;

            Assert.That(testCollection.AsEnumerable(), Is.Null);
        }
        public void AsEnumerable_EmptyCollectionShouldReturnEmptyResult()
        {
            var collection = new StringCollection();

            Assert.That(collection.AsEnumerable().Count(), Is.EqualTo(0));
        }
示例#4
0
 public static string ToDelimitedString(this StringCollection collection, string delimiter)
 {
     return(string.Join(delimiter, collection.AsEnumerable()));
 }