This repository was archived by the owner on May 1, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinline_test.go
More file actions
51 lines (45 loc) · 1.21 KB
/
inline_test.go
File metadata and controls
51 lines (45 loc) · 1.21 KB
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
50
51
package telegram
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestInlineQueryHasQuery(t *testing.T) {
t.Run("true", func(t *testing.T) {
iq := InlineQuery{Query: "sample text"}
assert.True(t, iq.HasQuery())
})
t.Run("false", func(t *testing.T) {
iq := InlineQuery{}
assert.False(t, iq.HasQuery())
})
}
func TestInlineQueryHasOffset(t *testing.T) {
t.Run("true", func(t *testing.T) {
iq := InlineQuery{Offset: "42"}
assert.True(t, iq.HasOffset())
})
t.Run("false", func(t *testing.T) {
iq := InlineQuery{}
assert.False(t, iq.HasOffset())
})
}
func TestInlineQueryHasLocation(t *testing.T) {
t.Run("true", func(t *testing.T) {
iq := InlineQuery{Location: &Location{Latitude: 56.085180, Longitude: 60.735150}}
assert.True(t, iq.HasLocation())
})
t.Run("false", func(t *testing.T) {
iq := InlineQuery{}
assert.False(t, iq.HasLocation())
})
}
func TestChosenInlineResultInlineQueryHasLocation(t *testing.T) {
t.Run("true", func(t *testing.T) {
cir := ChosenInlineResult{Location: &Location{Latitude: 56.085180, Longitude: 60.735150}}
assert.True(t, cir.HasLocation())
})
t.Run("false", func(t *testing.T) {
cir := ChosenInlineResult{}
assert.False(t, cir.HasLocation())
})
}