Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
1.3 kB · 46 lines
Swift
at main
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647//// URLQueryItemEncoderTests.swift// URLQueryItemCoder//// Created by Kyle Hughes on 1/15/23.//
#if canImport(Combine)import XCTest
@testable import URLQueryItemCoder
final class URLQueryItemEncoderTests: AbstractTopLevelEncoderTests<URLQueryItemEncoder> { // MARK: AbstractTopLevelEncoderTest Implementation override var expectedValues: CodableTestExpectation<[URLQueryItem]> { .urlQueryItems } override func target(using strategies: EncodingStrategies = .default) -> URLQueryItemEncoder { URLQueryItemEncoder(strategies: strategies) }}
// MARK: - Output Formatting Tests
extension URLQueryItemEncoderTests { // MARK: Keyed Value Sorted Keys Tests public func test_keyedValue_sortedKeys() throws { try XCTSkipIf(Self.isAbstractTestCase) let encodingStrategies = EncodingStrategies() let inputValue = CodableTestTypes.SingleValueProperties.Abridged.default let encoder = URLQueryItemEncoder(strategies: encodingStrategies, outputFormatting: .sortedKeys) let encodedValue = try encoder.encode(inputValue) let expectedValue = expectedValues.keyedValueSortedKeys(inputValue, encodingStrategies) XCTAssertEqual( encodedValue, expectedValue ) }}#endif