github.com/benoitkugler/goacve@v0.0.0-20201217100549-151ce6e55dc8/server/acvegestion/hello_asso_test.go (about) 1 package acvegestion 2 3 import ( 4 "encoding/json" 5 "fmt" 6 "testing" 7 8 "github.com/benoitkugler/goACVE/logs" 9 ) 10 11 func TestHelloAsso(t *testing.T) { 12 p := paiementHelloAsso{ 13 Id: "78970", 14 Amount: 845.789, 15 Type: "chèque", 16 } 17 b, _ := json.Marshal(p) 18 fmt.Println(string(b)) 19 } 20 21 func TestPing(t *testing.T) { 22 err := PingHelloAsso() 23 if err != nil { 24 t.Fatal(err) 25 } 26 } 27 28 func TestApiHelloAssoActions(t *testing.T) { 29 paiements, err := fetchAllPaiements(logs.HelloAsso) 30 if err != nil { 31 t.Fatal(err) 32 } 33 fmt.Println(" paiements:", len(paiements)) 34 } 35 36 func TestFetchDons(t *testing.T) { 37 ct := setup(t) 38 l, err := ct.importDonsHelloasso() 39 if err != nil { 40 t.Fatal(err) 41 } 42 fmt.Println(len(l)) 43 }