Skip to content

Commit

Permalink
Fix "(redundantInit) Remove explicit init if not required."
Browse files Browse the repository at this point in the history
  • Loading branch information
bgoncal committed Apr 18, 2024
1 parent 04d7b9b commit 59375d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Tests/HADataDecodable.test.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ internal class HADataDecodableTests: XCTestCase {

func testArrayDecodableSuccess() throws {
let data = HAData.array([.empty, .empty, .empty])
let result = try [RandomDecodable].init(data: data)
let result = try [RandomDecodable](data: data)
XCTAssertEqual(result.count, 3)
}

func testArrayDecodableFailureDueToRootData() {
let data = HAData.dictionary(["key": "value"])
XCTAssertThrowsError(try [RandomDecodable].init(data: data)) { error in
XCTAssertThrowsError(try [RandomDecodable](data: data)) { error in
XCTAssertEqual(error as? HADataError, .couldntTransform(key: "root"))
}
}

func testArrayDecodableFailureDueToInside() throws {
RandomDecodable.shouldThrow = true
let data = HAData.array([.empty, .empty, .empty])
XCTAssertThrowsError(try [RandomDecodable].init(data: data)) { error in
XCTAssertThrowsError(try [RandomDecodable](data: data)) { error in
XCTAssertEqual(error as? HADataError, .missingKey("any"))
}
}
Expand Down

0 comments on commit 59375d0

Please sign in to comment.