mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-07-16 17:48:51 +02:00
40 lines
760 B
Go
40 lines
760 B
Go
package events
|
|
|
|
import (
|
|
"reflect"
|
|
"testing"
|
|
)
|
|
|
|
func Test_removeEmptyCourses(t *testing.T) {
|
|
type args struct {
|
|
courses []string
|
|
}
|
|
tests := []struct {
|
|
name string
|
|
args args
|
|
want []string
|
|
}{
|
|
{
|
|
name: "Test remove empty courses",
|
|
args: args{
|
|
courses: []string{"", "test", "test2", ""},
|
|
},
|
|
want: []string{"test", "test2"},
|
|
},
|
|
{
|
|
name: "Test remove empty courses",
|
|
args: args{
|
|
courses: []string{"", "test", "test2", "", "test3"},
|
|
},
|
|
want: []string{"test", "test2", "test3"},
|
|
},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
if got := removeEmptyCourses(tt.args.courses); !reflect.DeepEqual(got, tt.want) {
|
|
t.Errorf("removeEmptyCourses() = %v, want %v", got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|