public void ShouldFailOnInvalidGenericTypeTryParseTest() { KeyValuePair<int, int> ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); result = dataTypeFascade.TryParse<KeyValuePair<int, int>>(DBNull.Value.ToString(), out ovalue); }
public void ShouldSpecialGetValueOnNullNullableTryParseTest() { object ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); result = dataTypeFascade.TryParse(typeof(int?), null, out ovalue); Assert.IsTrue(result); Assert.AreEqual((int?)null, ovalue); }
public void ShouldWithNullNotGetCharTest() { Char ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); Assert.IsFalse(result = dataTypeFascade.TryParse<Char>(null, out ovalue)); }
public void ShouldNotGetSingleTest() { Single ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); Assert.IsFalse(result = dataTypeFascade.TryParse<Single>("gibberish", out ovalue)); Assert.IsFalse(result = dataTypeFascade.TryParse<Single>("999,282,300,000,000,000,000,000,000,000,000,000,000.00", out ovalue)); }
public void ShouldNotGetUInt64Test() { UInt64 ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); Assert.IsFalse(result = dataTypeFascade.TryParse<UInt64>("gibberish", out ovalue)); Assert.IsFalse(result = dataTypeFascade.TryParse<UInt64>("99999999999999999999", out ovalue)); }
public void ShouldNotGetDoubleTest() { Double ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); Assert.IsFalse(result = dataTypeFascade.TryParse<Double>("gibberish", out ovalue)); Assert.IsFalse(result = dataTypeFascade.TryParse<Double>("999,769,313,486,232,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000.00", out ovalue)); }
public void ShouldNotGetGuidTest() { Guid ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); Assert.IsFalse(result = dataTypeFascade.TryParse<Guid>("gibberish", out ovalue)); }
public void ShouldGetDBNullTest() { DBNull ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); result = dataTypeFascade.TryParse<DBNull>("", out ovalue); Assert.IsTrue(result); Assert.AreEqual(DBNull.Value, ovalue); result = dataTypeFascade.TryParse<DBNull>("___", out ovalue); Assert.IsTrue(result); Assert.AreEqual(DBNull.Value, ovalue); }
public void ShouldGetDecimalTest() { Decimal ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); result = dataTypeFascade.TryParse<Decimal>("0", out ovalue); Assert.IsTrue(result); Assert.AreEqual(0, ovalue); }
public void ShouldGetCharTest() { Char ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); result = dataTypeFascade.TryParse<Char>("0", out ovalue); Assert.IsTrue(result); Assert.AreEqual('0', ovalue); }
public void ShouldGetDateTimeTest() { DateTime ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); result = dataTypeFascade.TryParse<DateTime>("6/22/2003", out ovalue); Assert.IsTrue(result); Assert.AreEqual(new DateTime(2003, 6, 22), ovalue); }
public void ShouldGetBooleanTest() { Boolean ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); result = dataTypeFascade.TryParse<Boolean>("true", out ovalue); Assert.IsTrue(result); Assert.AreEqual(true, ovalue); result = dataTypeFascade.TryParse<Boolean>("false", out ovalue); Assert.IsTrue(result); Assert.AreEqual(false, ovalue); }
public void ShouldFailOnNullTypeTryParseTest() { object ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); result = dataTypeFascade.TryParse(null, string.Empty, out ovalue); }
public void ShouldFailOnInvalidTypeTryParseTest() { object ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); result = dataTypeFascade.TryParse(typeof(KeyValuePair<int, int>), DBNull.Value.ToString(), out ovalue); }
public void ShouldNotGetDateTimeOffsetTest() { DateTimeOffset ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); Assert.IsFalse(result = dataTypeFascade.TryParse<DateTimeOffset>("gibberish", out ovalue)); }
public void ShouldGetEnumTest() { CharSet ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); result = dataTypeFascade.TryParse<CharSet>("Unicode", out ovalue); Assert.IsTrue(result); Assert.AreEqual(CharSet.Unicode, ovalue); }
public void ShouldNotGetDecimalTest() { Decimal ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); Assert.IsFalse(result = dataTypeFascade.TryParse<Decimal>("gibberish", out ovalue)); Assert.IsFalse(result = dataTypeFascade.TryParse<Decimal>("11111111111111111111111111111111111111", out ovalue)); }
public void ShouldGetGuidTest() { Guid ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); result = dataTypeFascade.TryParse<Guid>("{00000000-0000-0000-0000-000000000000}", out ovalue); Assert.IsTrue(result); Assert.AreEqual(Guid.Empty, ovalue); }
public void ShouldNotGetEnumTest() { CharSet ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); Assert.IsFalse(result = dataTypeFascade.TryParse<CharSet>("gibberish", out ovalue)); }
public void ShouldGetSingleTest() { Single ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); result = dataTypeFascade.TryParse<Single>("0", out ovalue); Assert.IsTrue(result); Assert.AreEqual(0, ovalue); }
public void ShouldNotGetSByteTest() { SByte ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); Assert.IsFalse(result = dataTypeFascade.TryParse<SByte>("gibberish", out ovalue)); Assert.IsFalse(result = dataTypeFascade.TryParse<SByte>("1111111111111111111", out ovalue)); }
public void ShouldGetStringTest() { String ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); result = dataTypeFascade.TryParse<String>("0-8-8-8-8-8-8-8-c", out ovalue); Assert.IsTrue(result); Assert.AreEqual("0-8-8-8-8-8-8-8-c", ovalue); }
public void ShouldNotGetTimeSpanTest() { TimeSpan ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); Assert.IsFalse(result = dataTypeFascade.TryParse<TimeSpan>("gibberish", out ovalue)); Assert.IsFalse(result = dataTypeFascade.TryParse<TimeSpan>("99999999.02:48:05.4775807", out ovalue)); }
public void ShouldGetTimeSpanTest() { TimeSpan ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); result = dataTypeFascade.TryParse<TimeSpan>("0:0:0", out ovalue); Assert.IsTrue(result); Assert.AreEqual(TimeSpan.Zero, ovalue); }
public void ShouldSpecialGetValueOnNullNullableGenericTryParseTest() { int? ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); result = dataTypeFascade.TryParse<int?>(null, out ovalue); Assert.IsTrue(result); Assert.AreEqual((int?)null, ovalue); }
public void ShouldGetUInt64Test() { UInt64 ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); result = dataTypeFascade.TryParse<UInt64>("0", out ovalue); Assert.IsTrue(result); Assert.AreEqual(0, ovalue); }
public void ShouldWithNullCanGetDBNullTest() { DBNull ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); Assert.IsTrue(result = dataTypeFascade.TryParse<DBNull>(null, out ovalue)); }
public void ShouldGetVersionTest() { Version ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); result = dataTypeFascade.TryParse<Version>("1.2.3.4", out ovalue); Assert.IsTrue(result); Assert.AreEqual(new Version(1, 2, 3, 4), ovalue); result = dataTypeFascade.TryParse<Version>("0.0.0.0", out ovalue); Assert.IsTrue(result); Assert.AreEqual(new Version(0, 0, 0, 0), ovalue); }
public void ShouldWithNullNotGetDateTimeTest() { DateTime ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); Assert.IsFalse(result = dataTypeFascade.TryParse<DateTime>(null, out ovalue)); }
public void ShouldWithNullNotGetVersionTest() { Version ovalue; bool result; DataTypeFascade dataTypeFascade; dataTypeFascade = new DataTypeFascade(); Assert.IsFalse(result = dataTypeFascade.TryParse<Version>(null, out ovalue)); }