Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasbzurovski committed Nov 29, 2024
1 parent 820f67d commit 18a0b26
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
6 changes: 4 additions & 2 deletions apple/Tests/TestCases/Prelude/NonFungibleGlobalIDTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@ final class NonFungibleGlobalIDTests: IdentifiableByStringProtocolTest<NonFungib

func test_valid_from_str() {
XCTAssertEqual(
try SUT("resource_rdx1nfyg2f68jw7hfdlg5hzvd8ylsa7e0kjl68t5t62v3ttamtejc9wlxa:<Member_237>"),
// swiftformat:disable redundantInit
try SUT.init("resource_rdx1nfyg2f68jw7hfdlg5hzvd8ylsa7e0kjl68t5t62v3ttamtejc9wlxa:<Member_237>"),
SUT.sample
)
}

func test_invalid_from_str() {
XCTAssertThrowsError(
try SUT("super invalid string!!!!")
// swiftformat:disable redundantInit
try SUT.init("super invalid string!!!!")
)
}

Expand Down
14 changes: 8 additions & 6 deletions apple/Tests/TestCases/Prelude/NonFungibleLocalIDTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ import XCTest
final class NonFungibleLocalIDTests: IdentifiableByStringProtocolTest<NonFungibleLocalID> {
// MARK: LocalID String
func test_valid_local_id_string_from_string() {
XCTAssertEqual(try SUT("<foo>"), SUT.str(value: "foo"))
XCTAssertEqual(SUT("<foo>"), SUT.str(value: "foo"))
}

func test_valid_local_id_string_from_integer() {
XCTAssertEqual(try SUT("#666#"), SUT.integer(value: 666))
XCTAssertEqual(SUT("#666#"), SUT.integer(value: 666))
}

func test_valid_local_id_string_from_ruid() {
XCTAssertEqual(try SUT("{deaddeaddeaddead-deaddeaddeaddead-deaddeaddeaddead-deaddeaddeaddead}"), SUT.ruid(value: .sample))
XCTAssertEqual(SUT("{deaddeaddeaddead-deaddeaddeaddead-deaddeaddeaddead-deaddeaddeaddead}"), SUT.ruid(value: .sample))
}

func test_valid_local_id_string_from_bytes() {
XCTAssertEqual(try SUT("[acedacedacedacedacedacedacedacedacedacedacedacedacedacedacedaced]"), SUT.bytes(value: NonEmptyMax64Bytes(bagOfBytes: Data.sampleAced)))
XCTAssertEqual(SUT("[acedacedacedacedacedacedacedacedacedacedacedacedacedacedacedaced]"), SUT.bytes(value: NonEmptyMax64Bytes(bagOfBytes: Data.sampleAced)))
}

// MARK: Integer
Expand All @@ -45,11 +45,13 @@ final class NonFungibleLocalIDTests: IdentifiableByStringProtocolTest<NonFungibl
}

func test_init_string_fails_when_given_user_facing_string() throws {
XCTAssertThrowsError(try SUT("x"))
// swiftformat:disable redundantInit
XCTAssertThrowsError(try SUT.init("x"))
}

func test_init_string_succeeds_when_given_raw_string() throws {
XCTAssertNoThrow(try SUT("<x>"))
// swiftformat:disable redundantInit
XCTAssertNoThrow(try SUT.init("<x>"))
}

func test_from_stringID_fails_when_given_raw_string() throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ final class ManifestBuildingTests: Test<TransactionManifest> {
}
XCTAssertFalse(hasLockFee())
let fee: Decimal192 = 531
manifest = try manifest.modify(lockFee: fee, addressOfFeePayer: addressOfFeePayer)
manifest = manifest.modify(lockFee: fee, addressOfFeePayer: addressOfFeePayer)
XCTAssertTrue(hasLockFee())
XCTAssert(manifest.description.contains(addressOfFeePayer.address))
}
Expand Down

0 comments on commit 18a0b26

Please sign in to comment.