Skip to content

Commit

Permalink
chore(test): can parse UOF.API.whoami/0 response
Browse files Browse the repository at this point in the history
  • Loading branch information
efcasado committed Apr 27, 2024
1 parent 4901790 commit cec0ea9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/data/whoami.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<bookmaker_details response_code="OK"
expire_at="2023-02-03T22:50:17Z" bookmaker_id="11111"
virtual_host="/unifiedfeed/11111" />
16 changes: 16 additions & 0 deletions test/uof_api_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ defmodule UOF.API.Test do

doctest UOF.API

## Betting descriptions
## =========================================================================

test "can parse 'descriptions/:lang/markets.xml' response" do
data = File.read!("test/data/markets.xml")

Expand Down Expand Up @@ -555,4 +558,17 @@ defmodule UOF.API.Test do
assert home_team.country_code == "DEU"
assert home_team.gender == "male"
end

## User information
## =========================================================================

test "can parse 'users/whoami.xml' response" do
data = File.read!("test/data/whoami.xml")

{:ok, details} = Saxaboom.parse(data, %UOF.API.Mappings.BookmakerDetails{})

assert details.expire_at == "2023-02-03T22:50:17Z"
assert details.bookmaker_id == "11111"
assert details.virtual_host == "/unifiedfeed/11111"
end
end

0 comments on commit cec0ea9

Please sign in to comment.