-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathspeech_test.go
70 lines (52 loc) · 1.26 KB
/
speech_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
package main
import (
"testing"
)
func TestSpeechNew(t *testing.T) {
s := NewSpeech("CC", 10)
if s.Number != 10 {
t.Error("Expected '10', got ", s.Number)
}
if s.ManualCode != "cc" {
t.Error("Expected 'cc', got", s.ManualCode)
}
if s.ManualName != "Competent Communicator" {
t.Error("Expected 'Competent Communicator', got", s.ManualName)
}
if s.Name != "Inspire Your Audience" {
t.Error("Expected 'Inspire Your Audience', got", s.Name)
}
if s.Min != 8 {
t.Error("Expected '8', got", s.Min)
}
if s.Max != 10 {
t.Error("Expected '10', got", s.Max)
}
}
func TestSpeechNewWithInvalidNumber(t *testing.T) {
s := NewSpeech("CC", 11)
if s.Number != 11 {
t.Error("Expected '11', got ", s.Number)
}
if s.ManualCode != "cc" {
t.Error("Expected 'cc', got", s.ManualCode)
}
if s.ManualName != "Competent Communicator" {
t.Error("Expected 'Competent Communicator', got", s.ManualName)
}
if s.Name != "" {
t.Error("Expected '', got", s.Name)
}
if s.Min != 0 {
t.Error("Expected '0', got", s.Min)
}
if s.Max != 0 {
t.Error("Expected '0', got", s.Max)
}
}
func TestSpeechInfo(t *testing.T) {
s := NewSpeech("CC", 1)
if s.info() != "#1 Ice Breaker (4-6 mins)" {
t.Error("Expected '#1 Ice Breaker (4-6 mins)', got", s.info())
}
}