Skip to content

Instantly share code, notes, and snippets.

@mokele
Created August 26, 2011 15:15
Show Gist options
  • Save mokele/1173635 to your computer and use it in GitHub Desktop.
Save mokele/1173635 to your computer and use it in GitHub Desktop.
order_executed_test_() ->
Qty = 100000,
Px = 2500,
{inparallel, [
fun() ->
{ok, C} = login_with_user(1),
?assertLoginResponse(1),
Side = buy,
ok = smk_client:order(C, Qty, Px, Side, ?MARKET_ID, ?CONTRACT_ID),
?assertOrderAccepted(2, OrderId, 2),
?assertOrderExecuted(3, OrderId, Qty, Px),
ok = smk_client:logout(C),
?assertLogoutConfirmation(4)
end,
fun() ->
{ok, C} = login_with_user(2),
?assertLoginResponse(1),
Side = sell,
ok = smk_client:order(C, Qty, Px, Side, ?MARKET_ID, ?CONTRACT_ID),
?assertOrderAccepted(2, OrderId, 2),
?assertOrderExecuted(3, OrderId, Qty, Px),
ok = smk_client:logout(C),
?assertLogoutConfirmation(4)
end
]}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment