Add default empty gen init test
This commit is contained in:
parent
92506042a1
commit
db0fdb641d
|
|
@ -20,6 +20,12 @@ final class EntityIdGenTests: XCTestCase {
|
|||
XCTAssertEqual(gen.nextId(), 0)
|
||||
}
|
||||
|
||||
func testGeneratorWithDefaultEmptyCollection() {
|
||||
gen = DefaultEntityIdGenerator(startProviding: [])
|
||||
XCTAssertEqual(gen.nextId(), 0)
|
||||
XCTAssertEqual(gen.nextId(), 1)
|
||||
}
|
||||
|
||||
func testLinearIncrement() {
|
||||
for i in 0..<1_000_000 {
|
||||
XCTAssertEqual(gen.nextId(), EntityIdentifier(EntityIdentifier.Identifier(i)))
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ extension EntityIdGenTests {
|
|||
("testGenerateWithInitialIds", testGenerateWithInitialIds),
|
||||
("testGeneratorDefaultInit", testGeneratorDefaultInit),
|
||||
("testGeneratorMarkUnused", testGeneratorMarkUnused),
|
||||
("testGeneratorWithDefaultEmptyCollection", testGeneratorWithDefaultEmptyCollection),
|
||||
("testLinearIncrement", testLinearIncrement)
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue