reworked time Calculations
This commit is contained in:
47
Backend/models/booking_test.go
Normal file
47
Backend/models/booking_test.go
Normal file
@@ -0,0 +1,47 @@
|
||||
package models_test
|
||||
|
||||
import (
|
||||
"arbeitszeitmessung/models"
|
||||
"time"
|
||||
)
|
||||
|
||||
var testBookingType = models.BookingType{
|
||||
Id: 1,
|
||||
Name: "Büro",
|
||||
}
|
||||
|
||||
var testBookings8hrs = []models.Booking{models.Booking{
|
||||
CardUID: "aaaa-aaaa",
|
||||
CheckInOut: 1,
|
||||
Timestamp: CatchError(time.Parse("2006-01-02 15:04", "2025-01-01 08:00")),
|
||||
BookingType: testBookingType,
|
||||
}, models.Booking{
|
||||
CardUID: "aaaa-aaaa",
|
||||
CheckInOut: 2,
|
||||
Timestamp: CatchError(time.Parse("2006-01-02 15:04", "2025-01-01 16:00")),
|
||||
BookingType: testBookingType,
|
||||
}}
|
||||
|
||||
var testBookings6hrs = []models.Booking{models.Booking{
|
||||
CardUID: "aaaa-aaaa",
|
||||
CheckInOut: 1,
|
||||
Timestamp: CatchError(time.Parse("2006-01-02 15:04", "2025-01-01 08:00")),
|
||||
BookingType: testBookingType,
|
||||
}, models.Booking{
|
||||
CardUID: "aaaa-aaaa",
|
||||
CheckInOut: 2,
|
||||
Timestamp: CatchError(time.Parse("2006-01-02 15:04", "2025-01-01 14:00")),
|
||||
BookingType: testBookingType,
|
||||
}}
|
||||
|
||||
var testBookings10hrs = []models.Booking{models.Booking{
|
||||
CardUID: "aaaa-aaaa",
|
||||
CheckInOut: 1,
|
||||
Timestamp: CatchError(time.Parse("2006-01-02 15:04", "2025-01-01 08:00")),
|
||||
BookingType: testBookingType,
|
||||
}, models.Booking{
|
||||
CardUID: "aaaa-aaaa",
|
||||
CheckInOut: 2,
|
||||
Timestamp: CatchError(time.Parse("2006-01-02 15:04", "2025-01-01 18:00")),
|
||||
BookingType: testBookingType,
|
||||
}}
|
||||
Reference in New Issue
Block a user