DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
Deveel.Data.Sql.MutableTableTests Class Reference
Inheritance diagram for Deveel.Data.Sql.MutableTableTests:
Deveel.Data.ContextBasedTest

Public Member Functions

void SameSessionInsertInto ()
 
void SameSessionDeleteFrom ()
 
- Public Member Functions inherited from Deveel.Data.ContextBasedTest
void TestSetUp ()
 
void TestFixtureSetUp ()
 
void TestTearDown ()
 
void TestFixtureTearDown ()
 

Protected Member Functions

override void OnSetUp (string testName)
 
- Protected Member Functions inherited from Deveel.Data.ContextBasedTest
virtual void RegisterServices (ServiceContainer container)
 
virtual ISystem CreateSystem ()
 
virtual IDatabase CreateDatabase (ISystem system, IConfiguration configuration)
 
virtual ISession CreateAdminSession (IDatabase database)
 
virtual IQuery CreateQuery (ISession session)
 
ISession CreateUserSession (string userName, string password)
 
virtual void OnTearDown ()
 

Private Member Functions

void InsertIntoTable (IMutableTable table)
 
IMutableTable CreateTable ()
 

Additional Inherited Members

- Protected Attributes inherited from Deveel.Data.ContextBasedTest
const string AdminUserName = "SA"
 
const string AdminPassword = "1234567890"
 
const string DatabaseName = "testdb"
 
- Properties inherited from Deveel.Data.ContextBasedTest
virtual bool SingleContext [get]
 
IQuery Query [get, private set]
 
ISystem System [get, private set]
 
IDatabase Database [get, private set]
 
ISession Session [get, private set]
 

Detailed Description

Definition at line 26 of file MutableTableTests.cs.

Member Function Documentation

IMutableTable Deveel.Data.Sql.MutableTableTests.CreateTable ( )
inlineprivate

Definition at line 55 of file MutableTableTests.cs.

55  {
56  var tableName = ObjectName.Parse("APP.test_table");
57  var tableInfo = new TableInfo(tableName);
58  tableInfo.AddColumn("name", PrimitiveTypes.String(), true);
59  tableInfo.AddColumn("age", PrimitiveTypes.Integer());
60  tableInfo.AddColumn("order", PrimitiveTypes.Integer());
61 
62  Query.CreateTable(tableInfo);
63  return Query.GetMutableTable(tableName);
64  }
Provides some helper functions for resolving and creating SqlType instances that are primitive to the...
Defines the metadata properties of a table existing within a database.
Definition: TableInfo.cs:41
void Deveel.Data.Sql.MutableTableTests.InsertIntoTable ( IMutableTable  table)
inlineprivate

Definition at line 35 of file MutableTableTests.cs.

35  {
36  var row = table.NewRow();
37  row.SetValue(0, "Antonello Provenzano");
38  row.SetValue(1, 33);
39  row.SetValue(2, 0);
40  table.AddRow(row);
41 
42  row = table.NewRow();
43  row.SetValue(0, "Maart Roosmaa");
44  row.SetValue(1, 28);
45  row.SetValue(2, 5);
46  table.AddRow(row);
47 
48  row = table.NewRow();
49  row.SetValue(0, "Rezaul Horaque");
50  row.SetValue(1, 27);
51  row.SetValue(2, 2);
52  table.AddRow(row);
53  }
RowId AddRow(Row row)
Persists a new row to the table.
override void Deveel.Data.Sql.MutableTableTests.OnSetUp ( string  testName)
inlineprotectedvirtual

Reimplemented from Deveel.Data.ContextBasedTest.

Definition at line 27 of file MutableTableTests.cs.

27  {
28  var table = CreateTable();
29 
30  if (testName != "InsertInto") {
31  InsertIntoTable(table);
32  }
33  }
void InsertIntoTable(IMutableTable table)
void Deveel.Data.Sql.MutableTableTests.SameSessionDeleteFrom ( )
inline

Definition at line 72 of file MutableTableTests.cs.

72  {
73  var queryExpression = SqlExpression.GreaterThan(SqlExpression.Reference(new ObjectName("order")), SqlExpression.Constant(2));
74 
75  int deleteCount = -1;
76  Assert.DoesNotThrow(() => deleteCount = Query.DeleteFrom(ObjectName.Parse("APP.test_table"), queryExpression));
77  Assert.AreEqual(1, deleteCount);
78  }
static SqlReferenceExpression Reference(ObjectName objectName)
Defines the base class for instances that represent SQL expression tree nodes.
static SqlConstantExpression Constant(object value)
static SqlBinaryExpression GreaterThan(SqlExpression left, SqlExpression right)
void Deveel.Data.Sql.MutableTableTests.SameSessionInsertInto ( )
inline

Definition at line 67 of file MutableTableTests.cs.

67  {
68  Assert.Inconclusive();
69  }

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