-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathband_test.go
40 lines (36 loc) · 934 Bytes
/
band_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
package main
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestBandFromHTMLElement(t *testing.T) {
tcs := []struct {
InputText string
ExpectedBand Band
}{
{
" Wed 1st, Some Stage(R) A Band",
Band{Name: "A Band", State: Rumoured, Stage: "Some Stage"},
},
{
" Wed 1st, Some Stage(SR) A Band",
Band{Name: "A Band", State: StronglyRumoured, Stage: "Some Stage"},
},
{
" Fri 24th, Other Stage(C) Blossoms",
Band{Name: "Blossoms", State: Confirmed, Stage: "Other Stage"},
},
{
" day TBC, Lost Horizon Sauna Solar Stage(TBC) Papaphone",
Band{Name: "Papaphone", State: TBC, Stage: "Lost Horizon Sauna Solar Stage"},
},
{
" day TBC, unknown stage(TBC) Woody Cook",
Band{Name: "Woody Cook", State: TBC, Stage: "unknown stage"},
},
}
for _, tc := range tcs {
actual := extractBandFromInputString(tc.InputText)
assert.Equal(t, tc.ExpectedBand, actual)
}
}