Merge commit '82380d2b' into remed/integration-w3
This commit is contained in:
+18
@@ -34,6 +34,24 @@ public sealed class AlarmConditionStateSchemaTests
|
||||
((long)cmd.ExecuteScalar()!).ShouldBe(1);
|
||||
}
|
||||
|
||||
/// <summary>Apply also creates the append-only comment table, keyed by alarm id + ordinal.</summary>
|
||||
[Fact]
|
||||
public void Apply_creates_the_comment_table_with_a_composite_key()
|
||||
{
|
||||
using var connection = OpenInMemory();
|
||||
|
||||
AlarmConditionStateSchema.Apply(connection);
|
||||
|
||||
using var cmd = connection.CreateCommand();
|
||||
cmd.CommandText = "SELECT name FROM pragma_table_info(@Name) WHERE pk > 0 ORDER BY pk";
|
||||
cmd.Parameters.AddWithValue("@Name", AlarmConditionStateSchema.CommentsTable);
|
||||
var pk = new List<string>();
|
||||
using (var reader = cmd.ExecuteReader())
|
||||
while (reader.Read()) pk.Add(reader.GetString(0));
|
||||
|
||||
pk.ShouldBe(["scripted_alarm_id", "seq"]);
|
||||
}
|
||||
|
||||
/// <summary>Applying twice on the same connection does not throw (CREATE TABLE IF NOT EXISTS).</summary>
|
||||
[Fact]
|
||||
public void Apply_is_idempotent()
|
||||
|
||||
Reference in New Issue
Block a user