コード例 #1
0
        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"));
        }
コード例 #2
0
        public void AsEnumerable_ShouldHandleNullCollection()
        {
            StringCollection testCollection = null;

            Assert.That(testCollection.AsEnumerable(), Is.Null);
        }
コード例 #3
0
        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()));
 }