coursed/schedule_test.go

29 lines
568 B
Go

package coursed
import (
"testing"
"time"
)
func TestSingleCourse(t *testing.T) {
testSch := Schedule{
Courses: map[string]CourseConfig{
"ubw101": CourseConfig{
StartTime: time.Now().Add(time.Minute * -5).Format(time.Kitchen),
EndTime: time.Now().Add(time.Minute * 10).Format(time.Kitchen),
Days: "MWF",
},
},
}
// TODO: Fix this
cur, err := testSch.CurrentCourse()
if err != nil {
t.Errorf("Error getting current course: %v", err)
}
if cur != "ubw101" {
t.Errorf("Expected current course to be ubw101, got %s", cur)
}
}