-
Notifications
You must be signed in to change notification settings - Fork 28
/
TermTest.kt
50 lines (43 loc) · 1020 Bytes
/
TermTest.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* Copyright (c) 2016. Michael Buhot m.buhot@gmail.com
*/
package mbuhot.eskotlin.query.term
import mbuhot.eskotlin.query.should_render_as
import org.junit.Test
class TermTest {
@Test
fun `test simple term`() {
val query = term {
"user" to "Kimchy"
}
query should_render_as """
{
"term" : {
"user" : {
"value": "Kimchy",
"boost": 1.0
}
}
}
"""
}
@Test
fun `test term with boost and name`() {
val query = term {
"status" {
value = "urgent"
boost = 2.0f
}
}
query should_render_as """
{
"term" : {
"status" : {
"value" : "urgent",
"boost" : 2.0
}
}
}
"""
}
}