Skip to content

Commit

Permalink
test: Removes unnecessary codable conf from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NeedleInAJayStack committed Nov 11, 2023
1 parent 5189104 commit 5278908
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Tests/GraphitiTests/ConnectionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import NIO
import XCTest

class ConnectionTests: XCTestCase {
struct Comment: Codable, Identifiable {
struct Comment: Identifiable {
let id: Int
let message: String
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/GraphitiTests/HelloWorldTests/HelloWorldTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct ID: Codable {
}
}

struct User: Codable {
struct User {
let id: String
let name: String?
let friends: [User]?
Expand Down Expand Up @@ -53,7 +53,7 @@ struct UserInput: Codable {
let friends: [UserInput]?
}

struct UserEvent: Codable {
struct UserEvent {
let user: User
}

Expand Down
14 changes: 7 additions & 7 deletions Tests/GraphitiTests/ProductAPI/ProductEntities.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import Graphiti

struct Product: Codable {
struct Product {
let id: String
let sku: String?
let package: String?
Expand Down Expand Up @@ -30,7 +30,7 @@ struct Product: Codable {
}
}

struct DeprecatedProduct: Codable {
struct DeprecatedProduct {
let sku: String
let package: String
let reason: String?
Expand All @@ -42,11 +42,11 @@ struct DeprecatedProduct: Codable {
}
}

struct ProductVariation: Codable {
struct ProductVariation {
let id: String
}

struct ProductResearch: Codable {
struct ProductResearch {
let study: CaseStudy
let outcome: String?

Expand All @@ -59,18 +59,18 @@ struct ProductResearch: Codable {
}
}

struct CaseStudy: Codable {
struct CaseStudy {
let caseNumber: String
let description: String?
}

struct ProductDimension: Codable {
struct ProductDimension {
let size: String?
let weight: Float?
let unit: String?
}

struct ProductUser: Codable {
struct ProductUser {
let email: String
let name: String?
let totalProductsCreated: Int?
Expand Down
24 changes: 12 additions & 12 deletions Tests/GraphitiTests/ScalarTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ScalarTests: XCTestCase {
// MARK: Test UUID converts to String as expected

func testUUIDOutput() throws {
struct UUIDOutput: Codable {
struct UUIDOutput {
let value: UUID
}

Expand Down Expand Up @@ -56,7 +56,7 @@ class ScalarTests: XCTestCase {
}

func testUUIDArg() throws {
struct UUIDOutput: Codable {
struct UUIDOutput {
let value: UUID
}

Expand Down Expand Up @@ -110,7 +110,7 @@ class ScalarTests: XCTestCase {
}

func testUUIDInput() throws {
struct UUIDOutput: Codable {
struct UUIDOutput {
let value: UUID
}

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

func testDateOutput() throws {
struct DateOutput: Codable {
struct DateOutput {
let value: Date
}

Expand Down Expand Up @@ -226,7 +226,7 @@ class ScalarTests: XCTestCase {
}

func testDateArg() throws {
struct DateOutput: Codable {
struct DateOutput {
let value: Date
}

Expand Down Expand Up @@ -285,7 +285,7 @@ class ScalarTests: XCTestCase {
}

func testDateInput() throws {
struct DateOutput: Codable {
struct DateOutput {
let value: Date
}

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

func testStringCoordOutput() throws {
struct CoordinateOutput: Codable {
struct CoordinateOutput {
let value: StringCodedCoordinate
}

Expand Down Expand Up @@ -401,7 +401,7 @@ class ScalarTests: XCTestCase {
}

func testStringCoordArg() throws {
struct CoordinateOutput: Codable {
struct CoordinateOutput {
let value: StringCodedCoordinate
}

Expand Down Expand Up @@ -455,7 +455,7 @@ class ScalarTests: XCTestCase {
}

func testStringCoordInput() throws {
struct CoordinateOutput: Codable {
struct CoordinateOutput {
let value: StringCodedCoordinate
}

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

func testDictCoordOutput() throws {
struct CoordinateOutput: Codable {
struct CoordinateOutput {
let value: DictCodedCoordinate
}

Expand Down Expand Up @@ -570,7 +570,7 @@ class ScalarTests: XCTestCase {
}

func testDictCoordArg() throws {
struct CoordinateOutput: Codable {
struct CoordinateOutput {
let value: DictCodedCoordinate
}

Expand Down Expand Up @@ -628,7 +628,7 @@ class ScalarTests: XCTestCase {
}

func testDictCoordInput() throws {
struct CoordinateOutput: Codable {
struct CoordinateOutput {
let value: DictCodedCoordinate
}

Expand Down
12 changes: 6 additions & 6 deletions Tests/GraphitiTests/StarWarsAPI/StarWarsEntities.swift
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
public enum Episode: String, Codable, CaseIterable {
public enum Episode: String, CaseIterable, Codable {
case newHope = "NEWHOPE"
case empire = "EMPIRE"
case jedi = "JEDI"
}

public protocol Character: Codable {
public protocol Character {
var id: String { get }
var name: String { get }
var friends: [String] { get }
var appearsIn: [Episode] { get }
}

public protocol SearchResult: Codable {}
public protocol SearchResult {}

public struct Planet: SearchResult, Codable {
public struct Planet: SearchResult {
public let id: String
public let name: String
public let diameter: Int
Expand All @@ -22,15 +22,15 @@ public struct Planet: SearchResult, Codable {
public var residents: [Human]
}

public struct Human: Character, SearchResult, Codable {
public struct Human: Character, SearchResult {
public let id: String
public let name: String
public let friends: [String]
public let appearsIn: [Episode]
public let homePlanet: Planet
}

public struct Droid: Character, SearchResult, Codable {
public struct Droid: Character, SearchResult {
public let id: String
public let name: String
public let friends: [String]
Expand Down
2 changes: 1 addition & 1 deletion Tests/GraphitiTests/StarWarsTests/StarWarsQueryTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ class StarWarsQueryTests: XCTestCase {
}

func testNonNullableFieldsQuery() throws {
struct A: Codable {
struct A {
func nullableA(context _: NoContext, arguments _: NoArguments) -> A? {
return A()
}
Expand Down

0 comments on commit 5278908

Please sign in to comment.