public void ConvertFrom_TypeError()
        {
            CommaDelimitedStringCollectionConverter cv = new CommaDelimitedStringCollectionConverter();
            object o;

            o = cv.ConvertFrom(null, null, 59);
            Assert.IsNull(o, "A1");
        }
        public void ConvertFrom_TypeError()
        {
            CommaDelimitedStringCollectionConverter cv = new CommaDelimitedStringCollectionConverter();
            object o = null;

            Assert.Throws <InvalidCastException>(() => o = cv.ConvertFrom(null, null, 59));
            Assert.Null(o);
        }
        public void ConvertFrom()
        {
            CommaDelimitedStringCollectionConverter cv = new CommaDelimitedStringCollectionConverter();
            object o;
            CommaDelimitedStringCollection col;

            o = cv.ConvertFrom(null, null, "hi,bye");
            Assert.AreEqual(typeof(CommaDelimitedStringCollection), o.GetType(), "A1");

            col = (CommaDelimitedStringCollection)o;
            Assert.AreEqual(2, col.Count, "A2");
            Assert.AreEqual("hi", col[0], "A3");
            Assert.AreEqual("bye", col[1], "A4");

            col = (CommaDelimitedStringCollection)cv.ConvertFrom(null, null, "hi, bye");
            Assert.AreEqual(2, col.Count, "A5");
            Assert.AreEqual("hi", col[0], "A6");
            Assert.AreEqual("bye", col[1], "A7");
        }
        public void ConvertFrom()
        {
            CommaDelimitedStringCollectionConverter cv = new CommaDelimitedStringCollectionConverter();
            object o;
            CommaDelimitedStringCollection col;

            o = cv.ConvertFrom(null, null, "hi,bye");
            Assert.Equal(typeof(CommaDelimitedStringCollection), o.GetType());

            col = (CommaDelimitedStringCollection)o;
            Assert.Equal(2, col.Count);
            Assert.Equal("hi", col[0]);
            Assert.Equal("bye", col[1]);

            col = (CommaDelimitedStringCollection)cv.ConvertFrom(null, null, "hi, bye");
            Assert.Equal(2, col.Count);
            Assert.Equal("hi", col[0]);
            Assert.Equal("bye", col[1]);
        }