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 pathstickers_test.go
More file actions
55 lines (49 loc) · 1.16 KB
/
stickers_test.go
File metadata and controls
55 lines (49 loc) · 1.16 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
52
53
54
55
package telegram
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestStickerInSet(t *testing.T) {
t.Run("true", func(t *testing.T) {
s := Sticker{SetName: "HotCherry"}
assert.True(t, s.InSet())
})
t.Run("false", func(t *testing.T) {
s := Sticker{}
assert.False(t, s.InSet())
})
}
func TestStickerHasThumb(t *testing.T) {
t.Run("true", func(t *testing.T) {
s := Sticker{Thumb: &PhotoSize{FileID: "abc"}}
assert.True(t, s.HasThumb())
})
t.Run("false", func(t *testing.T) {
s := Sticker{}
assert.False(t, s.HasThumb())
})
}
func TestStickerIsMask(t *testing.T) {
t.Run("true", func(t *testing.T) {
s := Sticker{MaskPosition: &MaskPosition{Point: PointEyes}}
assert.True(t, s.IsMask())
})
t.Run("false", func(t *testing.T) {
s := Sticker{}
assert.False(t, s.IsMask())
})
}
func TestStickerFile(t *testing.T) {
t.Run("valid", func(t *testing.T) {
s := Sticker{FileID: "abc", FileUniqueID: "really_abc", FileSize: 42}
assert.Equal(t, s.File(), File{
FileID: "abc",
FileUniqueID: "really_abc",
FileSize: 42,
})
})
t.Run("empty", func(t *testing.T) {
var s Sticker
assert.Equal(t, s.File(), File{})
})
}