ConvertFrom() public method

public ConvertFrom ( ITypeDescriptorContext ctx, CultureInfo ci, object data ) : object
ctx ITypeDescriptorContext
ci System.Globalization.CultureInfo
data object
return object
		public void ConvertFrom ()
		{
			InfiniteTimeSpanConverter cv = new InfiniteTimeSpanConverter ();
			object o;

			o = cv.ConvertFrom (null, null, "00:00:59");
			Assert.AreEqual (typeof (TimeSpan), o.GetType(), "A1");
			Assert.AreEqual (TimeSpan.FromSeconds (59), o, "A2");

			/* and now test infinity */
			o = cv.ConvertFrom (null, null, "Infinite");
			Assert.AreEqual (TimeSpan.MaxValue, o, "A3");
		}
		public void ConvertFrom_TypeError ()
		{
			InfiniteTimeSpanConverter cv = new InfiniteTimeSpanConverter ();
			object o;

			o = cv.ConvertFrom (null, null, 59);
			Assert.IsNull (o, "A1");
		}