internal RealtimeVolumeTick(int requestId, string str) { RequestId = requestId; TickType = TickType.RealtimeVolume; string[] parts = str.Split(';'); Price = ResponseParser.ParseDouble(parts[0]); Size = ResponseParser.ParseLong(parts[1]); Instant = Instant.FromUnixTimeMilliseconds(long.Parse(parts[2], NumberFormatInfo.InvariantInfo)); Volume = ResponseParser.ParseLong(parts[3]); Vwap = ResponseParser.ParseDouble(parts[4]); SingleTrade = ResponseParser.ParseBool(parts[5]); }
public void T04_Bool() { //Assert.Throws<ArgumentNullException>(() => parser.ParseBool(null)); Assert.False(ResponseParser.ParseBool("")); Assert.False(ResponseParser.ParseBool("faLse")); Assert.True(ResponseParser.ParseBool("TrUe")); Assert.False(ResponseParser.ParseBool("0")); Assert.True(ResponseParser.ParseBool("1")); Assert.True(ResponseParser.ParseBool("2")); Assert.Throws <ArgumentException>(() => ResponseParser.ParseBool("invalid")); //Assert.Throws<ArgumentException>(() => parser.ParseBool("true")); Assert.Empty(alerts); }
internal bool ReadBool() => ResponseParser.ParseBool(ReadString());