예제 #1
0
파일: Ticks.cs 프로젝트: dshe/InterReact
 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]);
 }
예제 #2
0
 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);
 }
예제 #3
0
 internal bool ReadBool() => ResponseParser.ParseBool(ReadString());