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()}.") });
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); }
public static string GetTickCacheKey(IHasRequestId t) => t is Tick tick?tick.TickType.ToStringFast() : "";