DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Deveel.Data.Sql.TableQueryTests Class Reference

Public Member Functions

void TestSetUp ()
 
void SelectRowsWhereStaticId (int id, int expectedRow)
 
void SelectRowsWhereStaticName (string name, int expectedRow)
 

Private Member Functions

void AddRow (TemporaryTable tmpTable, long id, string name, DateTimeOffset date)
 

Private Attributes

ITable table
 

Detailed Description

Definition at line 29 of file TableQueryTests.cs.

Member Function Documentation

void Deveel.Data.Sql.TableQueryTests.AddRow ( TemporaryTable  tmpTable,
long  id,
string  name,
DateTimeOffset  date 
)
inlineprivate

Definition at line 32 of file TableQueryTests.cs.

32  {
33  var row = new DataObject[3];
34  row[0] = DataObject.BigInt(id);
35  row[1] = DataObject.String(name);
36  row[2] = DataObject.Date(date);
37  tmpTable.NewRow(row);
38  }
static DataObject Date(DateTimeOffset value)
Definition: DataObject.cs:600
static DataObject String(string s)
Definition: DataObject.cs:592
Represents a dynamic object that encapsulates a defined SqlType and a compatible constant ISqlObject ...
Definition: DataObject.cs:35
static DataObject BigInt(long value)
Definition: DataObject.cs:580
void Deveel.Data.Sql.TableQueryTests.SelectRowsWhereStaticId ( int  id,
int  expectedRow 
)
inline

Definition at line 62 of file TableQueryTests.cs.

62  {
63  var result = table.SelectRows(0, SqlExpressionType.Equal, DataObject.BigInt(id));
64  var list = result.ToList();
65 
66  Assert.IsNotEmpty(list);
67  Assert.AreEqual(1, list.Count);
68  Assert.AreEqual(expectedRow, list[0]);
69  }
SqlExpressionType
All the possible type of SqlExpression supported
Represents a dynamic object that encapsulates a defined SqlType and a compatible constant ISqlObject ...
Definition: DataObject.cs:35
static DataObject BigInt(long value)
Definition: DataObject.cs:580
void Deveel.Data.Sql.TableQueryTests.SelectRowsWhereStaticName ( string  name,
int  expectedRow 
)
inline

Definition at line 73 of file TableQueryTests.cs.

73  {
74  var result = table.SelectRows(1, SqlExpressionType.Equal, DataObject.VarChar(name));
75  var list = result.ToList();
76 
77  Assert.IsNotEmpty(list);
78  Assert.AreEqual(1, list.Count);
79  Assert.AreEqual(expectedRow, list[0]);
80  }
SqlExpressionType
All the possible type of SqlExpression supported
Represents a dynamic object that encapsulates a defined SqlType and a compatible constant ISqlObject ...
Definition: DataObject.cs:35
static DataObject VarChar(string s)
Definition: DataObject.cs:622
void Deveel.Data.Sql.TableQueryTests.TestSetUp ( )
inline

Definition at line 41 of file TableQueryTests.cs.

41  {
42  var tableInfo = new TableInfo(new ObjectName("test_table"));
43  tableInfo.AddColumn("id", PrimitiveTypes.Numeric());
44  tableInfo.AddColumn("name", PrimitiveTypes.String());
45  tableInfo.AddColumn("date", PrimitiveTypes.DateTime());
46 
47  var cornerTime = DateTimeOffset.UtcNow;
48 
49  var tmpTable = new TemporaryTable(tableInfo);
50 
51  AddRow(tmpTable, 1, "test1", cornerTime);
52  AddRow(tmpTable, 2, "test2", cornerTime.AddSeconds(2));
53  AddRow(tmpTable, 3, "test3", cornerTime.AddSeconds(5));
54 
55  tmpTable.BuildIndexes();
56 
57  table = tmpTable;
58  }
Provides some helper functions for resolving and creating SqlType instances that are primitive to the...
static NumericType Numeric()
void AddRow(TemporaryTable tmpTable, long id, string name, DateTimeOffset date)
Defines the metadata properties of a table existing within a database.
Definition: TableInfo.cs:41

Member Data Documentation

ITable Deveel.Data.Sql.TableQueryTests.table
private

Definition at line 30 of file TableQueryTests.cs.


The documentation for this class was generated from the following file: