public override IEnumerable <ConvertTest> ConvertFromTestData() { yield return(ConvertTest.Valid("1", (decimal)1)); yield return(ConvertTest.Valid(1.1.ToString(), 1.1m)); yield return(ConvertTest.Valid(" -1 ", (decimal) - 1)); yield return(ConvertTest.Valid("+5", (decimal)5)); yield return(ConvertTest.Valid(" +5 ", (decimal)5)); yield return(ConvertTest.Throws <ArgumentException, Exception>("#2")); yield return(ConvertTest.Throws <ArgumentException, Exception>(" #2 ")); yield return(ConvertTest.Throws <ArgumentException, Exception>("0x3")); yield return(ConvertTest.Throws <ArgumentException>("0X3")); yield return(ConvertTest.Throws <ArgumentException>(" 0X3 ")); yield return(ConvertTest.Throws <ArgumentException>("&h4")); yield return(ConvertTest.Throws <ArgumentException>("&H4")); yield return(ConvertTest.Throws <ArgumentException>(" &H4 ")); foreach (ConvertTest test in base.ConvertFromTestData()) { yield return(test); } }
public override IEnumerable <ConvertTest> ConvertFromTestData() { yield return(ConvertTest.Valid("1", (UInt128)1)); yield return(ConvertTest.Valid("#2", (UInt128)2)); yield return(ConvertTest.Valid(" #2 ", (UInt128)2)); yield return(ConvertTest.Valid("0x3", (UInt128)3)); yield return(ConvertTest.Valid("0X3", (UInt128)3)); yield return(ConvertTest.Valid(" 0X3 ", (UInt128)3)); yield return(ConvertTest.Valid("&h4", (UInt128)4)); yield return(ConvertTest.Valid("&H4", (UInt128)4)); yield return(ConvertTest.Valid(" &H4 ", (UInt128)4)); yield return(ConvertTest.Valid("+5", (UInt128)5)); yield return(ConvertTest.Valid(" +5 ", (UInt128)5)); yield return(ConvertTest.Valid("!1", (UInt128)1, new CustomPositiveSymbolCulture())); yield return(ConvertTest.Throws <ArgumentException, Exception>("-1")); yield return(ConvertTest.Throws <ArgumentException, Exception>("340282366920938463463374607431768211456")); foreach (ConvertTest test in base.ConvertFromTestData()) { yield return(test); } }
public override IEnumerable <ConvertTest> ConvertFromTestData() { yield return(ConvertTest.Valid("1", (Int128)1)); yield return(ConvertTest.Valid(" -1 ", (Int128)(-1))); yield return(ConvertTest.Valid("#2", (Int128)2)); yield return(ConvertTest.Valid(" #2 ", (Int128)2)); yield return(ConvertTest.Valid("0x3", (Int128)3)); yield return(ConvertTest.Valid("0X3", (Int128)3)); yield return(ConvertTest.Valid(" 0X3 ", (Int128)3)); yield return(ConvertTest.Valid("&h4", (Int128)4)); yield return(ConvertTest.Valid("&H4", (Int128)4)); yield return(ConvertTest.Valid(" &H4 ", (Int128)4)); yield return(ConvertTest.Valid("+5", (Int128)5)); yield return(ConvertTest.Valid(" +5 ", (Int128)5)); yield return(ConvertTest.Throws <ArgumentException, Exception>("170141183460469231731687303715884105728")); yield return(ConvertTest.Throws <ArgumentException, Exception>("-170141183460469231731687303715884105729")); foreach (ConvertTest test in base.ConvertFromTestData()) { yield return(test); } }
public override IEnumerable <ConvertTest> ConvertFromTestData() { yield return(ConvertTest.Valid("1", (short)1)); yield return(ConvertTest.Valid(" -1 ", (short)-1)); yield return(ConvertTest.Valid("#2", (short)2)); yield return(ConvertTest.Valid(" #2 ", (short)2)); yield return(ConvertTest.Valid("0x3", (short)3)); yield return(ConvertTest.Valid("0X3", (short)3)); yield return(ConvertTest.Valid(" 0X3 ", (short)3)); yield return(ConvertTest.Valid("&h4", (short)4)); yield return(ConvertTest.Valid("&H4", (short)4)); yield return(ConvertTest.Valid(" &H4 ", (short)4)); yield return(ConvertTest.Valid("+5", (short)5)); yield return(ConvertTest.Valid(" +5 ", (short)5)); yield return(ConvertTest.Throws <ArgumentException, Exception>("32768")); yield return(ConvertTest.Throws <ArgumentException, Exception>("-32769")); foreach (ConvertTest test in base.ConvertFromTestData()) { yield return(test); } }
public override IEnumerable <ConvertTest> ConvertFromTestData() { yield return(ConvertTest.Valid("1", (ushort)1)); yield return(ConvertTest.Valid("#2", (ushort)2)); yield return(ConvertTest.Valid(" #2 ", (ushort)2)); yield return(ConvertTest.Valid("0x3", (ushort)3)); yield return(ConvertTest.Valid("0X3", (ushort)3)); yield return(ConvertTest.Valid(" 0X3 ", (ushort)3)); yield return(ConvertTest.Valid("&h4", (ushort)4)); yield return(ConvertTest.Valid("&H4", (ushort)4)); yield return(ConvertTest.Valid(" &H4 ", (ushort)4)); yield return(ConvertTest.Valid("+5", (ushort)5)); yield return(ConvertTest.Valid(" +5 ", (ushort)5)); yield return(ConvertTest.Valid("!1", (ushort)1, new CustomPositiveSymbolCulture())); yield return(ConvertTest.Throws <ArgumentException, Exception>("-1")); yield return(ConvertTest.Throws <ArgumentException, Exception>("65536")); foreach (ConvertTest test in base.ConvertFromTestData()) { yield return(test); } }
public override IEnumerable <ConvertTest> ConvertFromTestData() { yield return(ConvertTest.Valid("1", (long)1)); yield return(ConvertTest.Valid(" -1 ", (long)-1)); yield return(ConvertTest.Valid("#2", (long)2)); yield return(ConvertTest.Valid(" #2 ", (long)2)); yield return(ConvertTest.Valid("0x3", (long)3)); yield return(ConvertTest.Valid("0X3", (long)3)); yield return(ConvertTest.Valid(" 0X3 ", (long)3)); yield return(ConvertTest.Valid("&h4", (long)4)); yield return(ConvertTest.Valid("&H4", (long)4)); yield return(ConvertTest.Valid(" &H4 ", (long)4)); yield return(ConvertTest.Valid("+5", (long)5)); yield return(ConvertTest.Valid(" +5 ", (long)5)); yield return(ConvertTest.Throws <ArgumentException, Exception>("9223372036854775808")); yield return(ConvertTest.Throws <ArgumentException, Exception>("-9223372036854775809")); foreach (ConvertTest test in base.ConvertFromTestData()) { yield return(test); } }
public override IEnumerable <ConvertTest> ConvertFromTestData() { yield return(ConvertTest.Valid("1", 1)); yield return(ConvertTest.Valid(" -1 ", -1)); yield return(ConvertTest.Valid("#2", 2)); yield return(ConvertTest.Valid(" #2 ", 2)); yield return(ConvertTest.Valid("0x3", 3)); yield return(ConvertTest.Valid("0X3", 3)); yield return(ConvertTest.Valid(" 0X3 ", 3)); yield return(ConvertTest.Valid("&h4", 4)); yield return(ConvertTest.Valid("&H4", 4)); yield return(ConvertTest.Valid(" &H4 ", 4)); yield return(ConvertTest.Valid("+5", 5)); yield return(ConvertTest.Valid(" +5 ", 5)); yield return(ConvertTest.Throws <ArgumentException, Exception>("2147483648")); yield return(ConvertTest.Throws <ArgumentException, Exception>("-2147483649")); foreach (ConvertTest test in base.ConvertFromTestData()) { yield return(test); } }
public override IEnumerable <ConvertTest> ConvertFromTestData() { yield return(ConvertTest.Valid("false ", false)); yield return(ConvertTest.Valid("true", true, CultureInfo.InvariantCulture)); yield return(ConvertTest.Throws <FormatException>("1")); yield return(ConvertTest.CantConvertFrom(1)); yield return(ConvertTest.CantConvertFrom(null)); }
public override IEnumerable <ConvertTest> ConvertFromTestData() { yield return(ConvertTest.Valid(" a ", 'a')); yield return(ConvertTest.Valid(" ", '\0')); yield return(ConvertTest.Valid("", '\0')); yield return(ConvertTest.Throws <FormatException>("aa")); yield return(ConvertTest.CantConvertFrom(1)); yield return(ConvertTest.CantConvertFrom(null)); }
public override IEnumerable <ConvertTest> ConvertFromTestData() { yield return(ConvertTest.Valid(" {30da92c0-23e8-42a0-ae7c-734a0e5d2782}", new Guid(0x30da92c0, 0x23e8, 0x42a0, 0xae, 0x7c, 0x73, 0x4a, 0x0e, 0x5d, 0x27, 0x82))); yield return(ConvertTest.Valid("{30da92c0-23e8-42a0-ae7c-734a0e5d2782}", new Guid(0x30da92c0, 0x23e8, 0x42a0, 0xae, 0x7c, 0x73, 0x4a, 0x0e, 0x5d, 0x27, 0x82))); yield return(ConvertTest.Valid(" \t\r\n {30da92c0-23e8-42a0-ae7c-734a0e5d2782} \t\r\n ", new Guid(0x30da92c0, 0x23e8, 0x42a0, 0xae, 0x7c, 0x73, 0x4a, 0x0e, 0x5d, 0x27, 0x82))); yield return(ConvertTest.Throws <FormatException>("")); yield return(ConvertTest.Throws <FormatException>("invalid")); yield return(ConvertTest.CantConvertFrom(1)); yield return(ConvertTest.CantConvertFrom(new object())); }
public override IEnumerable <ConvertTest> ConvertFromTestData() { yield return(ConvertTest.Valid(" 1000.00:00:00 ", new TimeSpan(1000, 0, 0, 0, 0), CultureInfo.InvariantCulture)); yield return(ConvertTest.Valid("1000", new TimeSpan(1000, 0, 0, 0, 0))); yield return(ConvertTest.Throws <FormatException>("invalid")); yield return(ConvertTest.Throws <FormatException>(" ")); yield return(ConvertTest.Throws <FormatException>(string.Empty)); yield return(ConvertTest.CantConvertFrom(1)); yield return(ConvertTest.CantConvertFrom(new object())); }
public override IEnumerable <ConvertTest> ConvertFromTestData() { DateTime date = new DateTime(1998, 12, 5); yield return(ConvertTest.Valid("", DateTime.MinValue)); yield return(ConvertTest.Valid(" ", DateTime.MinValue)); yield return(ConvertTest.Valid(date.ToString(), date)); yield return(ConvertTest.Valid(date.ToString(CultureInfo.InvariantCulture.DateTimeFormat), date, CultureInfo.InvariantCulture)); yield return(ConvertTest.Valid(" " + date.ToString(CultureInfo.InvariantCulture.DateTimeFormat) + " ", date, CultureInfo.InvariantCulture)); yield return(ConvertTest.Throws <FormatException>("invalid")); yield return(ConvertTest.CantConvertFrom(new object())); yield return(ConvertTest.CantConvertFrom(1)); }
public override IEnumerable <ConvertTest> ConvertFromTestData() { TimeOnly timeOnly = new TimeOnly(10, 30, 50); yield return(ConvertTest.Valid("", TimeOnly.MinValue)); yield return(ConvertTest.Valid(" ", TimeOnly.MinValue)); yield return(ConvertTest.Valid(timeOnly.ToString(), TimeOnly.Parse(timeOnly.ToString()))); yield return(ConvertTest.Valid(timeOnly.ToString(CultureInfo.InvariantCulture.DateTimeFormat), TimeOnly.Parse(timeOnly.ToString(CultureInfo.InvariantCulture.DateTimeFormat)))); yield return(ConvertTest.Valid(" " + timeOnly.ToString(CultureInfo.InvariantCulture.DateTimeFormat) + " ", TimeOnly.Parse(timeOnly.ToString(CultureInfo.InvariantCulture.DateTimeFormat)))); yield return(ConvertTest.Throws <FormatException>("invalid")); yield return(ConvertTest.CantConvertFrom(new object())); yield return(ConvertTest.CantConvertFrom(1)); }
public override IEnumerable <ConvertTest> ConvertFromTestData() { yield return(ConvertTest.Valid("1", (short)1)); yield return(ConvertTest.Valid("-1 ", (short)-1)); yield return(ConvertTest.Valid("#2", (short)2)); yield return(ConvertTest.Valid("+7", (short)7)); yield return(ConvertTest.Throws <ArgumentException, Exception>("8.0")); yield return(ConvertTest.Throws <ArgumentException, Exception>("")); yield return(ConvertTest.Throws <ArgumentException, Exception>("bad")); yield return(ConvertTest.Throws <ArgumentException, Exception>("32768")); yield return(ConvertTest.Throws <ArgumentException, Exception>("-32769")); yield return(ConvertTest.CantConvertFrom(new object())); }
public override IEnumerable <ConvertTest> ConvertFromTestData() { yield return(ConvertTest.Valid("1", (float)1)); yield return(ConvertTest.Valid(1.1.ToString(), 1.1f)); yield return(ConvertTest.Valid(" -1 ", (float)-1)); yield return(ConvertTest.Valid("+5", (float)5)); yield return(ConvertTest.Valid(" +5 ", (float)5)); yield return(ConvertTest.Throws <ArgumentException, Exception>("#2")); yield return(ConvertTest.Throws <ArgumentException, Exception>(" #2 ")); yield return(ConvertTest.Throws <ArgumentException, Exception>("0x3")); if (!PlatformDetection.IsFullFramework) { yield return(ConvertTest.Throws <ArgumentException>("0X3")); yield return(ConvertTest.Throws <ArgumentException>(" 0X3 ")); yield return(ConvertTest.Throws <ArgumentException>("&h4")); yield return(ConvertTest.Throws <ArgumentException>("&H4")); yield return(ConvertTest.Throws <ArgumentException>(" &H4 ")); } foreach (ConvertTest test in base.ConvertFromTestData()) { yield return(test); } }
public override IEnumerable <ConvertTest> ConvertFromTestData() { yield return(ConvertTest.Throws <ArgumentException, Exception>("")); yield return(ConvertTest.Throws <ArgumentException, Exception>("bad")); yield return(ConvertTest.Throws <ArgumentException, Exception>("0x")); yield return(ConvertTest.Throws <ArgumentException, Exception>("0X")); yield return(ConvertTest.Throws <ArgumentException, Exception>("1x1")); yield return(ConvertTest.Throws <ArgumentException, Exception>("0y1")); yield return(ConvertTest.Throws <ArgumentException, Exception>("&h")); yield return(ConvertTest.Throws <ArgumentException, Exception>("&H")); yield return(ConvertTest.Throws <ArgumentException, Exception>("0h1")); yield return(ConvertTest.Throws <ArgumentException, Exception>("&i1")); yield return(ConvertTest.CantConvertFrom(new object())); }