Skip to content

Commit

Permalink
Improve deserialization test conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
Hopsaheysa committed Jan 12, 2024
1 parent b73ac6a commit 11a06ed
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions WultraMobileTokenSDKTests/NetworkingObjectsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,21 @@ class NetworkingObjectsTests: XCTestCase {
XCTFail("Failed to parse JSON data")
return
}

XCTAssert(result.responseObject?[0].formData.attributes.isEmpty == false, "There should be a Conversion Attribute, but attributes are empty.")

guard let attributes = result.responseObject?[0].formData.attributes else {
XCTFail("Failed to get attributes")
return
}

XCTAssertFalse(attributes.count == 0, "There should be a Conversion Attribute, but attributes are empty.")
XCTAssertFalse(attributes.count > 1, "There should be only a Conversion Attribute, so the amount attribute deserialization changed so also this test should change")

if let conversion = attributes.first as? WMTOperationAttributeAmountConversion {
XCTAssertEqual(conversion.type, .amountConversion, "The First attribute should be a Conversion Attribute.")
} else {
XCTFail("Failed to cast to WMTOperationAttributeAmountConversion")
}

}
}

Expand Down

0 comments on commit 11a06ed

Please sign in to comment.