2 using System.Collections.Generic;
13 [Trait(
"Category",
"Integration")]
22 var typeDefinition =
@"{ 24 ""name"": ""test_record"", 26 {""name"": ""id"", ""type"": ""int""}, 27 {""name"": ""name"", ""type"": ""string""} 31 var properties =
new Dictionary<string, IList<string>>
33 {
"id",
new List<string> {
"int",
"primary_key" } }
37 var createResponse = ctx.Kinetica.createType(typeDefinition,
"test_type", properties,
new Dictionary<string, string>());
38 var typeId = createResponse.type_id;
41 var hasTypeResponse = ctx.Kinetica.hasType(typeId,
new Dictionary<string, string>());
42 Assert.True(hasTypeResponse.type_exists,
"Type should exist");
45 var hasTypeResponseNonexistent = ctx.Kinetica.hasType(
"nonexistent_type_12345",
new Dictionary<string, string>());
46 Assert.False(hasTypeResponseNonexistent.type_exists,
"Non-existent type should not exist");
55 var typeDefinition =
@"{ 57 ""name"": ""test_record"", 59 {""name"": ""id"", ""type"": ""int""}, 60 {""name"": ""value"", ""type"": ""double""} 64 var properties =
new Dictionary<string, IList<string>>
66 {
"id",
new List<string> {
"int",
"primary_key" } }
69 var typeResponse = ctx.Kinetica.createType(typeDefinition,
"has_table_type", properties,
new Dictionary<string, string>());
72 var tableName = ctx.QualifiedTable(
"test_table");
73 ctx.Kinetica.createTable(tableName, typeResponse.type_id,
new Dictionary<string, string>());
76 var hasTableResponse = ctx.Kinetica.hasTable(tableName,
new Dictionary<string, string>());
77 Assert.True(hasTableResponse.table_exists,
"Table should exist");
78 Assert.Equal(tableName, hasTableResponse.table_name);
81 var nonexistentTable = ctx.QualifiedTable(
"nonexistent_table");
82 var hasTableResponseNonexistent = ctx.Kinetica.hasTable(nonexistentTable,
new Dictionary<string, string>());
83 Assert.False(hasTableResponseNonexistent.table_exists,
"Non-existent table should not exist");
92 var typeDefinition =
@"{ 94 ""name"": ""simple_record"", 96 {""name"": ""id"", ""type"": ""int""} 100 var properties =
new Dictionary<string, IList<string>>
102 {
"id",
new List<string> {
"int",
"primary_key" } }
105 var typeResponse = ctx.Kinetica.createType(typeDefinition,
"simple_type", properties,
new Dictionary<string, string>());
108 var tableName = ctx.QualifiedTable(
"simple_table");
109 var createTableResponse = ctx.Kinetica.createTable(tableName, typeResponse.type_id,
new Dictionary<string, string>());
110 Assert.Equal(tableName, createTableResponse.table_name);
113 var hasTableResponse = ctx.Kinetica.hasTable(tableName,
new Dictionary<string, string>());
114 Assert.True(hasTableResponse.table_exists);
117 var clearResponse = ctx.Kinetica.clearTable(tableName,
null,
new Dictionary<string, string>());
118 Assert.Equal(tableName, clearResponse.table_name);
121 var hasTableResponseAfter = ctx.Kinetica.hasTable(tableName,
new Dictionary<string, string>());
122 Assert.False(hasTableResponseAfter.table_exists,
"Table should not exist after clear");
132 Assert.NotEqual(ctx1.SchemaName, ctx2.SchemaName);
139 Assert.Equal(
"test_context_test", ctx.SchemaName);
140 Assert.Equal(
"test_context_test.my_table", ctx.QualifiedTable(
"my_table"));
Basic integration tests for core API functionality.
Test context that manages schema and cleanup for integration tests.
void TestSchemaIsolation()
void TestContextCreation()
void TestCreateAndClearTable()