-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_test.go
60 lines (50 loc) · 1.13 KB
/
create_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
51
52
53
54
55
56
57
58
59
60
// Copyright 2022 Jonas Kwiedor. All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package notifile_test
import (
"fmt"
"github.com/echgo/notifile"
"os"
"testing"
)
// TestCreate is to test the create function
func TestCreate(t *testing.T) {
tests := []struct {
path string
channels []string
headline string
message string
}{
{
path: os.TempDir(),
channels: []string{"gotify", "smtp"},
headline: "Testing",
message: "This is the fist message about test corners.",
},
{
path: os.TempDir(),
channels: []string{"smtp"},
headline: "Testing",
message: "This is the second message about test corners.",
},
{
path: os.TempDir(),
channels: []string{"trello"},
headline: "Testing",
message: "This is the third message about test corners.",
},
}
for _, value := range tests {
data := notifile.Data{
Channels: value.channels,
Headline: value.headline,
Message: value.message,
}
fmt.Println(value.path)
err := notifile.Create(data, value.path)
if err != nil {
t.Fatal(err)
}
}
}