mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-08-02 17:59:14 +02:00
test:#32 rewrite tests equal to function
This commit is contained in:
@@ -215,8 +215,7 @@ func Test_createTimeFromHourAndMinuteString(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func Test_addTimeToDate(t *testing.T) {
|
||||
europeTime, _ := time.LoadLocation("Europe/Berlin")
|
||||
func Test_replaceTimeInDate(t *testing.T) {
|
||||
type args struct {
|
||||
date time.Time
|
||||
time time.Time
|
||||
@@ -242,22 +241,6 @@ func Test_addTimeToDate(t *testing.T) {
|
||||
},
|
||||
want: time.Date(2021, 1, 1, 8, 15, 0, 0, time.UTC),
|
||||
},
|
||||
{
|
||||
name: "Test 3",
|
||||
args: args{
|
||||
date: time.Date(2002, 12, 31, 17, 0, 0, 0, time.UTC),
|
||||
time: time.Date(0, 0, 0, 8, 0, 0, 0, time.UTC),
|
||||
},
|
||||
want: time.Date(2003, 1, 1, 1, 0, 0, 0, time.UTC),
|
||||
},
|
||||
{
|
||||
name: "Test 4",
|
||||
args: args{
|
||||
date: time.Date(2023, 10, 29, 0, 0, 0, 0, europeTime),
|
||||
time: time.Date(0, 0, 0, 10, 0, 0, 0, time.UTC),
|
||||
},
|
||||
want: time.Date(2023, 10, 29, 9, 0, 0, 0, europeTime),
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user