TestNew | Default middleware creation | Returns UTC timezone when no timezone is detected |
TestWithOptions_FromHeader | Timezone detection from header | Reads timezone from X-Timezone header (America/New_York) |
TestWithOptions_FromCookie | Timezone detection from cookie | Reads timezone from cookie named “timezone” (Europe/London) |
TestWithOptions_FromQuery | Timezone detection from query parameter | Reads timezone from “tz” query parameter (Asia/Tokyo) |
TestWithOptions_SetCookie | Cookie setting functionality | Automatically sets timezone cookie when SetCookie=true |
TestWithOptions_InvalidTimezone | Invalid timezone handling | Falls back to UTC default when invalid timezone provided |
TestWithOptions_CustomDefault | Custom default timezone | Uses America/Los_Angeles as default instead of UTC |
TestLocation | Location helper function | Returns correct time.Location object (Europe/Paris) |
TestName | Name helper function | Returns timezone name string (Australia/Sydney) |
TestOffset | Offset helper function | Returns correct UTC offset in seconds (0 for UTC) |
TestNow | Now helper function | Returns current time in detected timezone location |
TestFromHeader | FromHeader constructor | Creates middleware that only reads from custom header (X-User-Tz) |
TestFromCookie | FromCookie constructor | Creates middleware that only reads from custom cookie (user_tz) |
TestWithDefault | WithDefault constructor | Creates middleware with custom default (Asia/Singapore) |
TestLookupPrecedence | Lookup order precedence | Header takes precedence over cookie and query when all are present |