fix:#57 fixed ss/ws check

This commit is contained in:
Elmar Kresse
2024-04-11 09:24:56 +02:00
parent c05dbc423c
commit 6e5521595d
2 changed files with 71 additions and 27 deletions

View File

@@ -18,8 +18,10 @@ package v2
import (
"htwkalender/model"
mockTime "htwkalender/service/functions/time"
"reflect"
"testing"
"time"
)
func Test_switchNameAndNotesForExam(t *testing.T) {
@@ -97,3 +99,40 @@ func Test_switchNameAndNotesForExam(t *testing.T) {
})
}
}
func Test_isSummerSemester(t *testing.T) {
type args struct {
clock mockTime.MockClock
}
tests := []struct {
name string
args args
want bool
}{
{
name: "is summer semester",
args: args{
clock: mockTime.MockClock{
NowTime: time.Date(2024, 6, 1, 0, 0, 0, 0, time.UTC),
},
},
want: true,
},
{
name: "is not summer semester",
args: args{
clock: mockTime.MockClock{
NowTime: time.Date(2024, 1, 1, 0, 0, 0, 0, time.UTC),
},
},
want: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := isSummerSemester(tt.args.clock); got != tt.want {
t.Errorf("isSummerSemester() = %v, want %v", got, tt.want)
}
})
}
}