-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_yogurt_template_test.go
78 lines (61 loc) · 1.15 KB
/
make_yogurt_template_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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package _3_template
import (
"fmt"
"testing"
)
type DragonFruit struct {
}
func (d *DragonFruit) CreateYogurt() {
fmt.Println("用鲜奶和乳酸菌发酵好酸奶")
}
func (d *DragonFruit) CutFruit() {
fmt.Println("把火龙果切成块块")
}
func (d *DragonFruit) Merge() {
fmt.Println("放在一起进行搅拌")
}
func (d *DragonFruit) Optimize() {
fmt.Println("调制出自己喜欢的味道")
}
func (d *DragonFruit) Eating() {
fmt.Println("开吃")
}
func (d *DragonFruit) Do() {
d.CreateYogurt()
d.CutFruit()
d.Merge()
d.Optimize()
d.Eating()
}
func TestDragonFruit(t *testing.T) {
d := &DragonFruit{}
d.Do()
}
type Mango struct {
}
func (m *Mango) CreateYogurt() {
fmt.Println("用鲜奶和乳酸菌发酵好酸奶")
}
func (m *Mango) CutFruit() {
fmt.Println("把芒果切成块块")
}
func (m *Mango) Merge() {
fmt.Println("放在一起进行搅拌")
}
func (m *Mango) Optimize() {
fmt.Println("调制出自己喜欢的味道")
}
func (m *Mango) Eating() {
fmt.Println("开吃")
}
func (m *Mango) Do() {
m.CreateYogurt()
m.CutFruit()
m.Merge()
m.Optimize()
m.Eating()
}
func TestMango(t *testing.T) {
m := &Mango{}
m.Do()
}