Example #1
0
 private static string GetAccountSummaryCacheKey(IHasRequestId o)
 {
     return(o switch
     {
         AccountSummary a => $"{a.Account}+{a.Currency}+{a.Tag}",
         AccountSummaryEnd => "AccountSummaryEnd",
         Alert _ => "",
         _ => throw new ArgumentException($"Unhandled type: {o.GetType()}.")
     });
Example #2
0
    public async Task TestSingle()
    {
        Contract contract = new()
        { SecurityType = SecurityType.Stock, Symbol = "IBM", Currency = "USD", Exchange = "SMART" };

        IList <IHasRequestId> messages = await MakeRequest(contract);

        IHasRequestId message = messages.Single();

        Assert.IsType <ContractDetails>(message);
    }
Example #3
0
 public static string GetTickCacheKey(IHasRequestId t) => t is Tick tick?tick.TickType.ToStringFast() : "";