Skip to content

Commit 870c23d

Browse files
committed
Improved test names
1 parent d825b0a commit 870c23d

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

entities/src/test/java/org/odk/collect/entities/javarosa/filter/LocalEntitiesFilterStrategyTest.kt

+11-8
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class LocalEntitiesFilterStrategyTest {
6767
}
6868

6969
@Test
70-
fun `returns matching nodes when id = value`() {
70+
fun `returns matching nodes in the optimized way when id = value`() {
7171
entitiesRepository.save("things", Entity.New("thing1", "Thing 1"))
7272
entitiesRepository.save("things", Entity.New("thing2", "Thing 2"))
7373

@@ -102,7 +102,7 @@ class LocalEntitiesFilterStrategyTest {
102102
}
103103

104104
@Test
105-
fun `returns matching nodes when id != value`() {
105+
fun `returns matching nodes in the optimized way when id != value`() {
106106
entitiesRepository.save("things", Entity.New("thing1", "Thing 1"))
107107
entitiesRepository.save("things", Entity.New("thing2", "Thing 2"))
108108

@@ -174,7 +174,7 @@ class LocalEntitiesFilterStrategyTest {
174174
}
175175

176176
@Test
177-
fun `returns empty nodeset when no entity matches name`() {
177+
fun `returns empty nodeset in the optimized way when no entity matches name`() {
178178
entitiesRepository.addList("things")
179179

180180
val scenario = Scenario.init(
@@ -208,7 +208,7 @@ class LocalEntitiesFilterStrategyTest {
208208
}
209209

210210
@Test
211-
fun `works correctly with non eq name expressions`() {
211+
fun `works correctly but not in the optimized way with non eq name expressions`() {
212212
entitiesRepository.save("things", Entity.New("thing", "Thing"))
213213

214214
val scenario = Scenario.init(
@@ -238,6 +238,7 @@ class LocalEntitiesFilterStrategyTest {
238238
)
239239

240240
assertThat(scenario.answerOf<StringData>("/data/calculate").value, equalTo("Thing"))
241+
assertThat(fallthroughFilterStrategy.fellThrough, equalTo(true))
241242
}
242243

243244
@Test
@@ -313,7 +314,7 @@ class LocalEntitiesFilterStrategyTest {
313314
}
314315

315316
@Test
316-
fun `returns matching nodes when entity matches property`() {
317+
fun `works correctly in the optimized way with property = expressions`() {
317318
entitiesRepository.save(
318319
"things",
319320
Entity.New(
@@ -410,7 +411,7 @@ class LocalEntitiesFilterStrategyTest {
410411
}
411412

412413
@Test
413-
fun `works correctly with label = expressions`() {
414+
fun `works correctly in the optimized way with label = expressions`() {
414415
entitiesRepository.save("things", Entity.New("thing1", "Thing1"))
415416

416417
val scenario = Scenario.init(
@@ -443,10 +444,11 @@ class LocalEntitiesFilterStrategyTest {
443444

444445
val choices = scenario.choicesOf("/data/question").map { it.value }
445446
assertThat(choices, containsInAnyOrder("thing1"))
447+
assertThat(fallthroughFilterStrategy.fellThrough, equalTo(false))
446448
}
447449

448450
@Test
449-
fun `works correctly with version = expressions`() {
451+
fun `works correctly in the optimized way with version = expressions`() {
450452
entitiesRepository.save("things", Entity.New("thing1", "Thing1", version = 2))
451453

452454
val scenario = Scenario.init(
@@ -479,10 +481,11 @@ class LocalEntitiesFilterStrategyTest {
479481

480482
val choices = scenario.choicesOf("/data/question").map { it.value }
481483
assertThat(choices, containsInAnyOrder("thing1"))
484+
assertThat(fallthroughFilterStrategy.fellThrough, equalTo(false))
482485
}
483486

484487
@Test
485-
fun `works correctly with complex expressions`() {
488+
fun `works correctly in the optimized way with combined eq expressions`() {
486489
entitiesRepository.save(
487490
"things",
488491
Entity.New(

0 commit comments

Comments
 (0)