Skip to content

Commit

Permalink
add tests for dx-link reflection issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kosyloa committed May 20, 2024
1 parent 4b364e5 commit 17d00ad
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions DXFeedFrameworkTests/DXConnectionTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,42 @@ final class DXConnectionTest: XCTestCase {
wait(for: [receivedEventsExpectation], timeout: 4)
}

func testDXLinkConnectionTheoPrice() throws {
// For token-based authorization, use the following address format:
// "dxlink:wss://demo.dxfeed.com/dxlink-ws[login=dxlink:token]"
let endpoint = try DXEndpoint.builder()
.build()

let subscription = try endpoint.getFeed()?.createSubscription(TheoPrice.self)
let receivedEventsExpectation = expectation(description: "Received events")
let eventListener = DXConnectionListener(expectation: receivedEventsExpectation)
try subscription?.add(listener: eventListener)
try subscription?.addSymbols(".AAPL240524C110")
try endpoint.connect("dxlink:wss://demo.dxfeed.com/dxlink-ws")
defer {
try? endpoint.closeAndAwaitTermination()
}
wait(for: [receivedEventsExpectation], timeout: 4)
}

func testDXLinkConnectionGreeks() throws {
// For token-based authorization, use the following address format:
// "dxlink:wss://demo.dxfeed.com/dxlink-ws[login=dxlink:token]"
let endpoint = try DXEndpoint.builder()
.build()

let subscription = try endpoint.getFeed()?.createSubscription(Greeks.self)
let receivedEventsExpectation = expectation(description: "Received events")
let eventListener = DXConnectionListener(expectation: receivedEventsExpectation)
try subscription?.add(listener: eventListener)
try subscription?.addSymbols(".AAPL240524C110")
try endpoint.connect("dxlink:wss://demo.dxfeed.com/dxlink-ws")
defer {
try? endpoint.closeAndAwaitTermination()
}
wait(for: [receivedEventsExpectation], timeout: 4)
}

func testConnection() throws {
// For token-based authorization, use the following address format:
// "demo.dxfeed.com:7300[login=entitle:token]"
Expand Down

0 comments on commit 17d00ad

Please sign in to comment.