-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoolbar_test.go
More file actions
35 lines (26 loc) · 757 Bytes
/
toolbar_test.go
File metadata and controls
35 lines (26 loc) · 757 Bytes
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
package main
import (
"testing"
"fyne.io/fyne/v2/test"
)
func TestApp_getToolBar(t *testing.T) {
tb := testApp.getToolBar()
if len(tb.Items) != 4 {
t.Errorf("Expected 4 items, got %v", len(tb.Items))
}
}
func TestApp_addHoldingsDialog(t *testing.T) {
testApp.addHoldingsDialog()
test.Type(testApp.AddHoldingsPurchaseAmountEntry, "1")
test.Type(testApp.AddHoldingsPurchasePriceEntry, "1000")
test.Type(testApp.AddHoldingsPurchaseDateEntry, "2020-01-01")
if testApp.AddHoldingsPurchaseDateEntry.Text != "2020-01-01" {
t.Error("date not correct")
}
if testApp.AddHoldingsPurchaseAmountEntry.Text != "1" {
t.Error("amount not correct")
}
if testApp.AddHoldingsPurchasePriceEntry.Text != "1000" {
t.Error("price not correct")
}
}