-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsalute_test.go
54 lines (47 loc) · 932 Bytes
/
salute_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
package polite
import "testing"
func TestSalute(t *testing.T) {
cases := []struct {
in string
want string
}{
{"Nick", "Good morning Mr. Nick"},
{"", "Hello nice to meet you!"},
}
for _, c := range cases {
got := Salute(c.in)
if got != c.want {
t.Errorf("Salute(%q) == %q, want %q", c.in, got, c.want)
}
}
}
func TestAurevoir(t *testing.T) {
cases := []struct {
in string
want string
}{
{"Nick", "Good night Mr. Nick"},
{"", "Bye nice to meet you!"},
}
for _, c := range cases {
got := Aurevoir(c.in)
if got != c.want {
t.Errorf("Aurevoir(%q) == %q, want %q", c.in, got, c.want)
}
}
}
func TestIntroduce(t *testing.T) {
cases := []struct {
in string
want string
}{
{"Nick", "Hello I am Lord Nick"},
{"", "Hello I am Lord "},
}
for _, c := range cases {
got := Introduce(c.in)
if got != c.want {
t.Errorf("Introduce(%q) == %q, want %q", c.in, got, c.want)
}
}
}