From cec0ea9b15c0de9d5bcf2258716efb857faf8128 Mon Sep 17 00:00:00 2001 From: Enrique Fernandez Date: Sat, 27 Apr 2024 10:59:08 +0200 Subject: [PATCH] chore(test): can parse UOF.API.whoami/0 response --- test/data/whoami.xml | 4 ++++ test/uof_api_test.exs | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 test/data/whoami.xml diff --git a/test/data/whoami.xml b/test/data/whoami.xml new file mode 100644 index 0000000..9d086a4 --- /dev/null +++ b/test/data/whoami.xml @@ -0,0 +1,4 @@ + + diff --git a/test/uof_api_test.exs b/test/uof_api_test.exs index 2d10d83..a9ba45c 100644 --- a/test/uof_api_test.exs +++ b/test/uof_api_test.exs @@ -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") @@ -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