From 0d2fca665fd42c839f704c5a8d4b5883ccce066d Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Sat, 11 May 2024 18:44:25 +0400 Subject: [PATCH] Fix typos --- .../RequestBuilder/RequestBodyEncoder/RequestBodyEncoder.swift | 2 +- .../Classes/Core/Models/RequestBody.swift | 2 +- .../Tests/UnitTests/RequestParametersEncoderTests.swift | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Sources/NetworkLayer/Classes/Core/Builders/RequestBuilder/RequestBodyEncoder/RequestBodyEncoder.swift b/Sources/NetworkLayer/Classes/Core/Builders/RequestBuilder/RequestBodyEncoder/RequestBodyEncoder.swift index db481d4..59d70ca 100644 --- a/Sources/NetworkLayer/Classes/Core/Builders/RequestBuilder/RequestBodyEncoder/RequestBodyEncoder.swift +++ b/Sources/NetworkLayer/Classes/Core/Builders/RequestBuilder/RequestBodyEncoder/RequestBodyEncoder.swift @@ -25,7 +25,7 @@ struct RequestBodyEncoder: IRequestBodyEncoder { request.httpBody = data case let .encodable(encodable): request.httpBody = try jsonEncoder.encode(encodable) - case let .dictonary(dictionary): + case let .dictionary(dictionary): request.httpBody = try JSONSerialization.data(withJSONObject: dictionary) } } diff --git a/Sources/NetworkLayerInterfaces/Classes/Core/Models/RequestBody.swift b/Sources/NetworkLayerInterfaces/Classes/Core/Models/RequestBody.swift index f884d5c..3fbd4b9 100644 --- a/Sources/NetworkLayerInterfaces/Classes/Core/Models/RequestBody.swift +++ b/Sources/NetworkLayerInterfaces/Classes/Core/Models/RequestBody.swift @@ -8,5 +8,5 @@ import Foundation public enum RequestBody { case data(Data) case encodable(Encodable) - case dictonary([String: Any]) + case dictionary([String: Any]) } diff --git a/Tests/NetworkLayerTests/Classes/Tests/UnitTests/RequestParametersEncoderTests.swift b/Tests/NetworkLayerTests/Classes/Tests/UnitTests/RequestParametersEncoderTests.swift index 9cb4a31..1c4b21b 100644 --- a/Tests/NetworkLayerTests/Classes/Tests/UnitTests/RequestParametersEncoderTests.swift +++ b/Tests/NetworkLayerTests/Classes/Tests/UnitTests/RequestParametersEncoderTests.swift @@ -1,6 +1,6 @@ // // network-layer -// Copyright © 2023 Space Code. All rights reserved. +// Copyright © 2024 Space Code. All rights reserved. // import Foundation @@ -42,6 +42,7 @@ final class RequestParametersEncoderTests: XCTestCase { func test_thatRequestParametersEncoderThrowsAnError_whenURLIsNotValid() { // given var requestMock = URLRequest.fake(string: .wrongURL) + requestMock.url = nil // when var receivedError: NSError?