-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathsheets_test.go
63 lines (52 loc) · 1.51 KB
/
sheets_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
package main
import (
"gopkg.in/Iwark/spreadsheet.v2"
"testing"
)
func TestGetBoard(t *testing.T) {
columns := make([][]spreadsheet.Cell, 2)
columns[1] = make([]spreadsheet.Cell, 7)
columns[1][0] = spreadsheet.Cell{Value: "president"}
columns[1][1] = spreadsheet.Cell{Value: "vpe"}
columns[1][2] = spreadsheet.Cell{Value: "vpm"}
columns[1][3] = spreadsheet.Cell{Value: "vppr"}
columns[1][4] = spreadsheet.Cell{Value: "secretary"}
columns[1][5] = spreadsheet.Cell{Value: "treasurer"}
columns[1][6] = spreadsheet.Cell{Value: "saa"}
sheet := spreadsheet.Sheet{Columns: columns}
board := NewBoard(&sheet)
if board.President != "president" {
t.Error("Expected 'president', got ", board.President)
}
if board.VPE != "vpe" {
t.Error("Expected 'vpe', got ", board.VPE)
}
if board.VPM != "vpm" {
t.Error("Expected 'vpm', got ", board.VPM)
}
if board.VPPR != "vppr" {
t.Error("Expected 'vppr', got ", board.VPPR)
}
if board.Secretary != "secretary" {
t.Error("Expected 'secretary', got ", board.Secretary)
}
if board.Treasurer != "treasurer" {
t.Error("Expected 'treasurer', got ", board.Treasurer)
}
if board.SAA != "saa" {
t.Error("Expected 'saa', got ", board.SAA)
}
}
func TestParseManualAndNumber(t *testing.T) {
speech := "Ann Addicks\nCC #4 "
name, manual, num := parseManualAndNumber(speech)
if name != "Ann Addicks" {
t.Error("Expected 'Ann Addicks', got ", name)
}
if manual != "CC" {
t.Error("Expected 'CC', got ", manual)
}
if num != 4 {
t.Error("Expected '4', got ", num)
}
}