Files
ccn/Packages/Infrastructure/Tests/Utils/Contexts/StubRequestContext.swift
T
2026-08-19 23:19:08 +02:00

27 lines
693 B
Swift

import Hummingbird
import Infrastructure
/// A ``LocalizedRequestContext`` carrying the core storage and the negotiated language only.
struct StubRequestContext: LocalizedRequestContext {
// MARK: Properties
/// The core request context storage Hummingbird requires.
var coreContext: CoreRequestContextStorage
/// The language identifier negotiated for the request.
var language: String
// MARK: Initializers
/// Creates a request context for the given source.
/// - Parameter source: the source the context is initialized from.
init(
source: Source
) {
self.coreContext = .init(source: source)
self.language = ""
}
}