Code cleanup after moving tests

This commit is contained in:
Tapac
2020-01-24 01:57:03 +03:00
parent cbcabf9b54
commit c046988bb5
2 changed files with 11 additions and 10 deletions

View File

@@ -14,21 +14,22 @@ import java.util.*
object DMLTestsData {
object Cities : Table() {
val id = Cities.integer("cityId").autoIncrement("cities_seq").primaryKey() // PKColumn<Int>
val name = Cities.varchar("name", 50) // Column<String>
val id = integer("cityId").autoIncrement("cities_seq") // PKColumn<Int>
val name = varchar("name", 50) // Column<String>
override val primaryKey = PrimaryKey(id)
}
object Users : Table() {
val id = Users.varchar("id", 10).primaryKey() // PKColumn<String>
val name =
Users.varchar("name", length = 50) // Column<String>
val cityId = (Users.integer("city_id") references Cities.id).nullable() // Column<Int?>
val id = varchar("id", 10) // PKColumn<String>
val name = varchar("name", length = 50) // Column<String>
val cityId = reference("city_id", Cities.id).nullable() // Column<Int?>
override val primaryKey = PrimaryKey(Cities.id)
}
object UserData : Table() {
val user_id = UserData.varchar("user_id", 10) references Users.id
val comment = UserData.varchar("comment", 30)
val value = UserData.integer("value")
val user_id = varchar("user_id", 10) references Users.id
val comment = varchar("comment", 30)
val value = integer("value")
}
}

View File

@@ -87,7 +87,7 @@ class InsertTests : DatabaseTestsBase() {
it[idTable.id] = EntityID(1, idTable)
it[idTable.name] = "1"
} get idTable.id
assertEquals(1, id?.value)
assertEquals(1, id.value)
}
}