forked from fyne-io/fyne
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp_test.go
50 lines (34 loc) · 882 Bytes
/
app_test.go
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
package app
import (
"testing"
"github.com/stretchr/testify/assert"
"fyne.io/fyne/v2"
_ "fyne.io/fyne/v2/test"
)
func TestDummyApp(t *testing.T) {
app := NewWithID("io.fyne.test")
app.Quit()
}
func TestCurrentApp(t *testing.T) {
app := NewWithID("io.fyne.test")
assert.Equal(t, app, fyne.CurrentApp())
}
func TestFyneApp_UniqueID(t *testing.T) {
appID := "io.fyne.test"
app := NewWithID(appID)
assert.Equal(t, appID, app.UniqueID())
meta.ID = "fakedInject"
app = New()
assert.Equal(t, meta.ID, app.UniqueID())
}
func TestFyneApp_SetIcon(t *testing.T) {
app := NewWithID("io.fyne.test")
metaIcon := &fyne.StaticResource{StaticName: "Metadata"}
SetMetadata(fyne.AppMetadata{
Icon: metaIcon,
})
assert.Equal(t, metaIcon, app.Icon())
setIcon := &fyne.StaticResource{StaticName: "Test"}
app.SetIcon(setIcon)
assert.Equal(t, setIcon, app.Icon())
}