20 using NUnit.Framework;
24 [Category(
"Data Objects")]
29 const string s =
"Test string";
31 Assert.IsNotNull(sObj);
33 Assert.AreEqual(
SqlTypeCode.VarChar, sObj.Type.TypeCode);
34 Assert.IsInstanceOf<
SqlString>(sObj.Value);
35 Assert.AreEqual(s, sObj.Value);
40 const string s =
"Test string";
44 Assert.IsNotNull(sObj1);
45 Assert.IsNotNull(sObj2);
47 Assert.IsTrue(sObj1.IsComparableTo(sObj2));
48 Assert.AreEqual(0, sObj1.CompareTo(sObj2));
53 const string s1 =
"First test string that comes ";
54 const string s2 =
"before the second test string";
58 Assert.IsNotNull(sObj1);
59 Assert.IsNotNull(sObj2);
61 Assert.IsTrue(sObj1.IsComparableTo(sObj2));
64 Assert.DoesNotThrow(() => result = sObj1.
Add(sObj2));
65 Assert.IsNotNull(result);
66 Assert.AreEqual(
"First test string that comes before the second test string", (
string)result);
71 const string s =
"78998";
74 Assert.IsNotNull(obj);
76 Assert.AreEqual(
SqlTypeCode.VarChar, obj.Type.TypeCode);
80 Assert.IsNotNull(result);
83 Assert.AreEqual(78998, result);
89 const string s =
"fail";
92 Assert.IsNotNull(obj);
94 Assert.AreEqual(
SqlTypeCode.VarChar, obj.Type.TypeCode);
98 Assert.IsNotNull(result);
100 Assert.IsTrue(result.
IsNull);
104 [Category(
"Booleans")]
106 const string s =
"true";
109 Assert.IsNotNull(obj);
111 Assert.AreEqual(
SqlTypeCode.VarChar, obj.Type.TypeCode);
115 Assert.IsNotNull(result);
117 Assert.IsFalse(result.
IsNull);
118 Assert.AreEqual(
true, (
bool)result);
Provides some helper functions for resolving and creating SqlType instances that are primitive to the...
bool IsNull
Gets a value that indicates if this object is materialized as null.
SqlType Type
Gets the SqlType that defines the object properties
void BasicVarChar_Convert_ToInteger_Fail()
DataObject CastTo(SqlType destType)
Converts this object to the given SqlType.
static BooleanType Boolean()
SqlTypeCode TypeCode
Gets the kind of SQL type this data-type handles.
void BasicVarChar_Convert_ToInteger_Success()
static NumericType Numeric()
void BasicVarChar_Create()
Represents a dynamic object that encapsulates a defined SqlType and a compatible constant ISqlObject ...
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
void BasicVarChar_Compare()
static DataObject VarChar(string s)
DataObject Add(DataObject other)
Adds the given value to this object value.
void BasicVarChar_Convert_ToBoolean_Success()