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.Index.BlindSearchTests Class Reference

Public Member Functions

void TestSetUp ()
 
void SelectEqualOneColumn ()
 
void SelectEqualTwoColumns ()
 
void SelectGreater ()
 

Private Member Functions

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

Private Attributes

ITable table
 
DateTimeOffset cornerTime
 

Detailed Description

Definition at line 29 of file BlindSearchTests.cs.

Member Function Documentation

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

Definition at line 55 of file BlindSearchTests.cs.

55  {
56  var row = new DataObject[3];
57  row[0] = DataObject.BigInt(id);
58  row[1] = DataObject.String(name);
59  row[2] = DataObject.Date(date);
60  tmpTable.NewRow(row);
61  }
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.Index.BlindSearchTests.SelectEqualOneColumn ( )
inline

Definition at line 64 of file BlindSearchTests.cs.

64  {
65  var name = DataObject.String("test1");
66  var result = table.SelectRowsEqual(1, name);
67 
68  Assert.IsNotNull(result);
69  Assert.IsNotEmpty(result);
70 
71  var index = result.First();
72  Assert.AreEqual(0, index);
73  }
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
void Deveel.Data.Index.BlindSearchTests.SelectEqualTwoColumns ( )
inline

Definition at line 76 of file BlindSearchTests.cs.

76  {
77  var name = DataObject.String("test1");
78  var id = DataObject.BigInt(1);
79 
80  var result = table.SelectRowsEqual(1, name, 0, id);
81  Assert.IsNotNull(result);
82  Assert.IsNotEmpty(result);
83 
84  var index = result.First();
85  Assert.AreEqual(0, index);
86  }
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.Index.BlindSearchTests.SelectGreater ( )
inline

Definition at line 89 of file BlindSearchTests.cs.

89  {
90  var id = DataObject.BigInt(1);
91 
92  var result = table.SelectRowsGreater(0, id);
93 
94  Assert.IsNotNull(result);
95  Assert.IsNotEmpty(result);
96  Assert.AreEqual(2, result.Count());
97 
98  Assert.AreEqual(1, result.First());
99  }
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.Index.BlindSearchTests.TestSetUp ( )
inline

Definition at line 35 of file BlindSearchTests.cs.

35  {
36  var tableName = ObjectName.Parse("APP.test_table");
37  var tableInfo = new TableInfo(tableName);
38  tableInfo.AddColumn("id", PrimitiveTypes.Numeric(), true);
39  tableInfo.AddColumn("name", PrimitiveTypes.String(SqlTypeCode.VarChar));
40  tableInfo.AddColumn("date", PrimitiveTypes.DateTime());
41 
42  cornerTime = DateTimeOffset.UtcNow;
43 
44  var tmpTable = new TemporaryTable(tableInfo);
45 
46  AddRow(tmpTable, 1, "test1", cornerTime);
47  AddRow(tmpTable, 2, "test2", cornerTime.AddSeconds(2));
48  AddRow(tmpTable, 3, "test3", cornerTime.AddSeconds(5));
49 
50  tmpTable.BuildIndexes(DefaultIndexTypes.BlindSearch);
51 
52  table = tmpTable;
53  }
Provides some helper functions for resolving and creating SqlType instances that are primitive to the...
static ObjectName Parse(string s)
Parses the given string into a ObjectName object.
Definition: ObjectName.cs:139
Describes the name of an object within a database.
Definition: ObjectName.cs:44
static NumericType Numeric()
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
Definition: SqlTypeCode.cs:23
Defines the metadata properties of a table existing within a database.
Definition: TableInfo.cs:41
void AddRow(TemporaryTable tmpTable, long id, string name, DateTimeOffset date)

Member Data Documentation

DateTimeOffset Deveel.Data.Index.BlindSearchTests.cornerTime
private

Definition at line 32 of file BlindSearchTests.cs.

ITable Deveel.Data.Index.BlindSearchTests.table
private

Definition at line 30 of file BlindSearchTests.cs.


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