public void GetDeleteOperation_deletes_row() { var hp = CreateSqliteHistoryRepo(); var expected = new SqlOperation { Sql = "DELETE FROM \"__migrationHistory\" WHERE \"MigrationId\" = 'exodus';" }; var actual = hp.GetDeleteOperation("exodus") as SqlOperation; Assert.Equal(expected.IsDestructiveChange, actual.IsDestructiveChange); Assert.Equal(expected.Sql, actual.Sql); Assert.Equal(expected.SuppressTransaction, actual.SuppressTransaction); }
public void GetInsertOperation_deletes_row() { var hp = CreateSqliteHistoryRepo(); var typename = typeof(TestContext).FullName; var expected = new SqlOperation { Sql = $"INSERT INTO \"__migrationHistory\" (\"MigrationId\", \"ContextKey\", \"ProductVersion\") VALUES ('m5', '{typename}', '7');" }; var historyRow = new HistoryRow("m5", "7"); var actual = hp.GetInsertOperation(historyRow) as SqlOperation; Assert.Equal(expected.IsDestructiveChange, actual.IsDestructiveChange); Assert.Equal(expected.Sql, actual.Sql); Assert.Equal(expected.SuppressTransaction, actual.SuppressTransaction); }