Skip to content

Commit 28f6bbe

Browse files
test: Removes unnecessary codable conf from tests
1 parent a6f7b52 commit 28f6bbe

File tree

6 files changed

+29
-29
lines changed

6 files changed

+29
-29
lines changed

Tests/GraphitiTests/ConnectionTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import NIO
44
import XCTest
55

66
class ConnectionTests: XCTestCase {
7-
struct Comment: Codable, Identifiable {
7+
struct Comment: Identifiable {
88
let id: Int
99
let message: String
1010
}

Tests/GraphitiTests/HelloWorldTests/HelloWorldTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct ID: Codable {
2121
}
2222
}
2323

24-
struct User: Codable {
24+
struct User {
2525
let id: String
2626
let name: String?
2727
let friends: [User]?
@@ -53,7 +53,7 @@ struct UserInput: Codable {
5353
let friends: [UserInput]?
5454
}
5555

56-
struct UserEvent: Codable {
56+
struct UserEvent {
5757
let user: User
5858
}
5959

Tests/GraphitiTests/ProductAPI/ProductEntities.swift

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22
import Graphiti
33

4-
struct Product: Codable {
4+
struct Product {
55
let id: String
66
let sku: String?
77
let package: String?
@@ -30,7 +30,7 @@ struct Product: Codable {
3030
}
3131
}
3232

33-
struct DeprecatedProduct: Codable {
33+
struct DeprecatedProduct {
3434
let sku: String
3535
let package: String
3636
let reason: String?
@@ -42,11 +42,11 @@ struct DeprecatedProduct: Codable {
4242
}
4343
}
4444

45-
struct ProductVariation: Codable {
45+
struct ProductVariation {
4646
let id: String
4747
}
4848

49-
struct ProductResearch: Codable {
49+
struct ProductResearch {
5050
let study: CaseStudy
5151
let outcome: String?
5252

@@ -59,18 +59,18 @@ struct ProductResearch: Codable {
5959
}
6060
}
6161

62-
struct CaseStudy: Codable {
62+
struct CaseStudy {
6363
let caseNumber: String
6464
let description: String?
6565
}
6666

67-
struct ProductDimension: Codable {
67+
struct ProductDimension {
6868
let size: String?
6969
let weight: Float?
7070
let unit: String?
7171
}
7272

73-
struct ProductUser: Codable {
73+
struct ProductUser {
7474
let email: String
7575
let name: String?
7676
let totalProductsCreated: Int?

Tests/GraphitiTests/ScalarTests.swift

+12-12
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class ScalarTests: XCTestCase {
88
// MARK: Test UUID converts to String as expected
99

1010
func testUUIDOutput() throws {
11-
struct UUIDOutput: Codable {
11+
struct UUIDOutput {
1212
let value: UUID
1313
}
1414

@@ -56,7 +56,7 @@ class ScalarTests: XCTestCase {
5656
}
5757

5858
func testUUIDArg() throws {
59-
struct UUIDOutput: Codable {
59+
struct UUIDOutput {
6060
let value: UUID
6161
}
6262

@@ -110,7 +110,7 @@ class ScalarTests: XCTestCase {
110110
}
111111

112112
func testUUIDInput() throws {
113-
struct UUIDOutput: Codable {
113+
struct UUIDOutput {
114114
let value: UUID
115115
}
116116

@@ -173,7 +173,7 @@ class ScalarTests: XCTestCase {
173173
// MARK: Test Date scalars convert to String using ISO8601 encoders
174174

175175
func testDateOutput() throws {
176-
struct DateOutput: Codable {
176+
struct DateOutput {
177177
let value: Date
178178
}
179179

@@ -226,7 +226,7 @@ class ScalarTests: XCTestCase {
226226
}
227227

228228
func testDateArg() throws {
229-
struct DateOutput: Codable {
229+
struct DateOutput {
230230
let value: Date
231231
}
232232

@@ -285,7 +285,7 @@ class ScalarTests: XCTestCase {
285285
}
286286

287287
func testDateInput() throws {
288-
struct DateOutput: Codable {
288+
struct DateOutput {
289289
let value: Date
290290
}
291291

@@ -353,7 +353,7 @@ class ScalarTests: XCTestCase {
353353
// MARK: Test a scalar that converts to a single-value Map (StringCodedCoordinate -> String)
354354

355355
func testStringCoordOutput() throws {
356-
struct CoordinateOutput: Codable {
356+
struct CoordinateOutput {
357357
let value: StringCodedCoordinate
358358
}
359359

@@ -401,7 +401,7 @@ class ScalarTests: XCTestCase {
401401
}
402402

403403
func testStringCoordArg() throws {
404-
struct CoordinateOutput: Codable {
404+
struct CoordinateOutput {
405405
let value: StringCodedCoordinate
406406
}
407407

@@ -455,7 +455,7 @@ class ScalarTests: XCTestCase {
455455
}
456456

457457
func testStringCoordInput() throws {
458-
struct CoordinateOutput: Codable {
458+
struct CoordinateOutput {
459459
let value: StringCodedCoordinate
460460
}
461461

@@ -518,7 +518,7 @@ class ScalarTests: XCTestCase {
518518
// MARK: Test a scalar that converts to a multi-value Map (Coordinate -> Dict)
519519

520520
func testDictCoordOutput() throws {
521-
struct CoordinateOutput: Codable {
521+
struct CoordinateOutput {
522522
let value: DictCodedCoordinate
523523
}
524524

@@ -570,7 +570,7 @@ class ScalarTests: XCTestCase {
570570
}
571571

572572
func testDictCoordArg() throws {
573-
struct CoordinateOutput: Codable {
573+
struct CoordinateOutput {
574574
let value: DictCodedCoordinate
575575
}
576576

@@ -628,7 +628,7 @@ class ScalarTests: XCTestCase {
628628
}
629629

630630
func testDictCoordInput() throws {
631-
struct CoordinateOutput: Codable {
631+
struct CoordinateOutput {
632632
let value: DictCodedCoordinate
633633
}
634634

Tests/GraphitiTests/StarWarsAPI/StarWarsEntities.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
public enum Episode: String, Codable, CaseIterable {
1+
public enum Episode: String, CaseIterable, Codable {
22
case newHope = "NEWHOPE"
33
case empire = "EMPIRE"
44
case jedi = "JEDI"
55
}
66

7-
public protocol Character: Codable {
7+
public protocol Character {
88
var id: String { get }
99
var name: String { get }
1010
var friends: [String] { get }
1111
var appearsIn: [Episode] { get }
1212
}
1313

14-
public protocol SearchResult: Codable {}
14+
public protocol SearchResult {}
1515

16-
public struct Planet: SearchResult, Codable {
16+
public struct Planet: SearchResult {
1717
public let id: String
1818
public let name: String
1919
public let diameter: Int
@@ -22,15 +22,15 @@ public struct Planet: SearchResult, Codable {
2222
public var residents: [Human]
2323
}
2424

25-
public struct Human: Character, SearchResult, Codable {
25+
public struct Human: Character, SearchResult {
2626
public let id: String
2727
public let name: String
2828
public let friends: [String]
2929
public let appearsIn: [Episode]
3030
public let homePlanet: Planet
3131
}
3232

33-
public struct Droid: Character, SearchResult, Codable {
33+
public struct Droid: Character, SearchResult {
3434
public let id: String
3535
public let name: String
3636
public let friends: [String]

Tests/GraphitiTests/StarWarsTests/StarWarsQueryTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ class StarWarsQueryTests: XCTestCase {
625625
}
626626

627627
func testNonNullableFieldsQuery() throws {
628-
struct A: Codable {
628+
struct A {
629629
func nullableA(context _: NoContext, arguments _: NoArguments) -> A? {
630630
return A()
631631
}

0 commit comments

Comments
 (0)