forked from adyzng/go-duka
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dukapp_test.go
43 lines (37 loc) · 910 Bytes
/
dukapp_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
package main
import (
"fmt"
"testing"
clog "github.com/go-clog/clog"
)
func TestDukaApp(t *testing.T) {
args := argsList{
Verbose: true,
Header: true,
Spread: 20,
Model: 0,
Symbol: "EURUSD",
Output: "f:\\00",
Format: "csv",
Period: "M1",
Start: "2017-01-01",
End: "2017-01-03",
}
opt, err := ParseOption(args)
if err != nil {
fmt.Println(err)
return
}
fmt.Printf(" Output: %s\n", opt.Folder)
fmt.Printf(" Symbol: %s\n", opt.Symbol)
fmt.Printf(" Spread: %d\n", opt.Spread)
fmt.Printf(" Mode: %d\n", opt.Mode)
fmt.Printf(" Timeframe: %d\n", opt.Timeframe)
fmt.Printf(" Format: %s\n", opt.Format)
fmt.Printf(" CsvHeader: %t\n", opt.CsvHeader)
fmt.Printf(" StartDate: %s\n", opt.Start.Format("2006-01-02:15H"))
fmt.Printf(" EndDate: %s\n", opt.End.Format("2006-01-02:15H"))
defer clog.Shutdown()
app := NewApp(opt)
app.Execute()
}