From 84870c4c9ad9f4530bc045b3a81ecd84fc83ef36 Mon Sep 17 00:00:00 2001 From: S4cha Date: Tue, 12 Apr 2022 12:09:24 +0200 Subject: [PATCH] Removes unused test code --- .../Api Implementation/ConcreteJSONApi.swift | 23 ------------- .../Code/Api Implementation/JSONPost.swift | 33 ------------------- .../NetworkingTests/Code/App Domain/Api.swift | 15 --------- .../Code/App Domain/Post.swift | 22 ------------- Tests/NetworkingTests/NetworkingTests.swift | 2 -- 5 files changed, 95 deletions(-) delete mode 100644 Tests/NetworkingTests/Code/Api Implementation/ConcreteJSONApi.swift delete mode 100644 Tests/NetworkingTests/Code/Api Implementation/JSONPost.swift delete mode 100644 Tests/NetworkingTests/Code/App Domain/Api.swift delete mode 100644 Tests/NetworkingTests/Code/App Domain/Post.swift diff --git a/Tests/NetworkingTests/Code/Api Implementation/ConcreteJSONApi.swift b/Tests/NetworkingTests/Code/Api Implementation/ConcreteJSONApi.swift deleted file mode 100644 index dbd67d2..0000000 --- a/Tests/NetworkingTests/Code/Api Implementation/ConcreteJSONApi.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// ConcreteApi.swift -// -// -// Created by Sacha DSO on 30/01/2020. -// - -import Foundation -import Networking -import Combine - -struct ConcreteApi: Api, NetworkingService { - - let network: NetworkingClient = NetworkingClient(baseURL: "https://jsonplaceholder.typicode.com") - - func fetchPost() -> AnyPublisher { - get("/posts/1") - } - - func fetchPosts() -> AnyPublisher<[Post], Error> { - get("/posts") - } -} diff --git a/Tests/NetworkingTests/Code/Api Implementation/JSONPost.swift b/Tests/NetworkingTests/Code/Api Implementation/JSONPost.swift deleted file mode 100644 index 44a656d..0000000 --- a/Tests/NetworkingTests/Code/Api Implementation/JSONPost.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// JSONPost.swift -// -// -// Created by Sacha DSO on 30/01/2020. -// - -import Foundation -import Networking - -struct JSONPost: Decodable { - let identifier: Int - let userId: Int - let title: String - let body: String - - enum CodingKeys: String, CodingKey { - case identifier = "id" - case userId - case title - case body - } -} - -/* -JSON: -{ - "userId": 1, - "id": 1, - "title": "delectus aut autem", - "completed": false -} -*/ diff --git a/Tests/NetworkingTests/Code/App Domain/Api.swift b/Tests/NetworkingTests/Code/App Domain/Api.swift deleted file mode 100644 index 718e6aa..0000000 --- a/Tests/NetworkingTests/Code/App Domain/Api.swift +++ /dev/null @@ -1,15 +0,0 @@ -// -// Api.swift -// -// -// Created by Sacha DSO on 30/01/2020. -// - -import Foundation -import Combine - -// Your async api not depending on any networking details (http etc) -protocol Api { - func fetchPost() -> AnyPublisher - func fetchPosts() -> AnyPublisher<[Post], Error> -} diff --git a/Tests/NetworkingTests/Code/App Domain/Post.swift b/Tests/NetworkingTests/Code/App Domain/Post.swift deleted file mode 100644 index b29e39b..0000000 --- a/Tests/NetworkingTests/Code/App Domain/Post.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// Post.swift -// -// -// Created by Sacha DSO on 30/01/2020. -// - -import Foundation - -struct Post: Decodable { - let identifier: Int - let userId: Int - let title: String - let body: String - - enum CodingKeys: String, CodingKey { - case identifier = "id" - case userId - case title - case body - } -} diff --git a/Tests/NetworkingTests/NetworkingTests.swift b/Tests/NetworkingTests/NetworkingTests.swift index 19d2628..cc55e8f 100644 --- a/Tests/NetworkingTests/NetworkingTests.swift +++ b/Tests/NetworkingTests/NetworkingTests.swift @@ -2,8 +2,6 @@ import XCTest import Networking import Combine -extension Post: NetworkingJSONDecodable {} - final class NetworkingTests: XCTestCase { var cancellables = Set()