public void Should_Convert_Type_Update() { // Arrange var message = $"Q,DONT_CARE_SYMBOL"; var fields = new[] { DynamicFieldset.Symbol }; // Act var dynamicFields = Level1DynamicFields.Parse(message, fields); // Assert Assert.AreEqual(dynamicFields.Type, "Q"); }
public void Should_Convert_Tick() { // Arrange var message = $"Q,DONT_CARE_SYMBOL,{IntegerValue}"; var fields = new[] { DynamicFieldset.Symbol, DynamicFieldset.Tick }; // Act var dynamicFields = Level1DynamicFields.Parse(message, fields); // Assert Assert.AreEqual(dynamicFields.Tick, IntegerValue); }
public void Should_Convert_Symbol() { // Arrange var message = "Q,AAPL"; var fields = new[] { DynamicFieldset.Symbol }; // Act var dynamicFields = Level1DynamicFields.Parse(message, fields); // Assert Assert.AreEqual(dynamicFields.Symbol, "AAPL"); }
public void Should_Convert_SettlementDate() { // Arrange var message = $"Q,DONT_CARE_SYMBOL,{DateTimeStringValue}"; var fields = new[] { DynamicFieldset.Symbol, DynamicFieldset.SettlementDate }; // Act var dynamicFields = Level1DynamicFields.Parse(message, fields); // Assert Assert.AreEqual(dynamicFields.SettlementDate, _dateTimeValue); }
public void Should_Convert_Spread() { // Arrange var message = $"Q,DONT_CARE_SYMBOL,{DoubleValue}"; var fields = new[] { DynamicFieldset.Symbol, DynamicFieldset.Spread }; // Act var dynamicFields = Level1DynamicFields.Parse(message, fields); // Assert Assert.AreEqual(dynamicFields.Spread, DoubleValue); }
public void Should_Convert_PercentOffAverageVolume() { // Arrange var message = $"Q,DONT_CARE_SYMBOL,{DoubleValue}"; var fields = new[] { DynamicFieldset.Symbol, DynamicFieldset.PercentOffAverageVolume }; // Act var dynamicFields = Level1DynamicFields.Parse(message, fields); // Assert Assert.AreEqual(dynamicFields.PercentOffAverageVolume, DoubleValue); }
public void Should_Convert_RestrictedCode() { // Arrange var message = $"Q,DONT_CARE_SYMBOL,{StringValue}"; var fields = new[] { DynamicFieldset.Symbol, DynamicFieldset.RestrictedCode }; // Act var dynamicFields = Level1DynamicFields.Parse(message, fields); // Assert Assert.AreEqual(dynamicFields.RestrictedCode, StringValue); }
public void Should_Convert_MostRecentTradeMarketCenter() { // Arrange var message = $"Q,DONT_CARE_SYMBOL,{IntegerValue}"; var fields = new[] { DynamicFieldset.Symbol, DynamicFieldset.MostRecentTradeMarketCenter }; // Act var dynamicFields = Level1DynamicFields.Parse(message, fields); // Assert Assert.AreEqual(dynamicFields.MostRecentTradeMarketCenter, IntegerValue); }
public void Should_Convert_MostRecentTradeTime() { // Arrange var message = $"Q,DONT_CARE_SYMBOL,{TimeSpanStringValue}"; var fields = new[] { DynamicFieldset.Symbol, DynamicFieldset.MostRecentTradeTime }; // Act var dynamicFields = Level1DynamicFields.Parse(message, fields); // Assert Assert.AreEqual(dynamicFields.MostRecentTradeTime, _timeSpanValue); }
public void Should_Convert_MarketCapitalization() { // Arrange var message = $"Q,DONT_CARE_SYMBOL,{DoubleValue}"; var fields = new[] { DynamicFieldset.Symbol, DynamicFieldset.MarketCapitalization }; // Act var dynamicFields = Level1DynamicFields.Parse(message, fields); // Assert Assert.AreEqual(dynamicFields.MarketCapitalization, DoubleValue); }
public void Should_Convert_FinancialStatusIndicator() { // Arrange var message = $"Q,DONT_CARE_SYMBOL,{StringValue}"; var fields = new[] { DynamicFieldset.Symbol, DynamicFieldset.FinancialStatusIndicator }; // Act var dynamicFields = Level1DynamicFields.Parse(message, fields); // Assert Assert.AreEqual(dynamicFields.FinancialStatusIndicator, StringValue); }
public void Should_Convert_ExtendedTradingDifference() { // Arrange var message = $"Q,DONT_CARE_SYMBOL,{DoubleValue}"; var fields = new[] { DynamicFieldset.Symbol, DynamicFieldset.ExtendedTradingDifference }; // Act var dynamicFields = Level1DynamicFields.Parse(message, fields); // Assert Assert.AreEqual(dynamicFields.ExtendedTradingDifference, DoubleValue); }
public void Should_Convert_DecimalPrecision() { // Arrange var message = $"Q,DONT_CARE_SYMBOL,{StringValue}"; var fields = new[] { DynamicFieldset.Symbol, DynamicFieldset.DecimalPrecision }; // Act var dynamicFields = Level1DynamicFields.Parse(message, fields); // Assert Assert.AreEqual(dynamicFields.DecimalPrecision, StringValue); }
public void Should_Convert_AvailableRegions() { // Arrange var message = $"Q,DONT_CARE_SYMBOL,{StringValue}"; var fields = new[] { DynamicFieldset.Symbol, DynamicFieldset.AvailableRegions }; // Act var dynamicFields = Level1DynamicFields.Parse(message, fields); // Assert Assert.AreEqual(dynamicFields.AvailableRegions, StringValue); }
public void Should_Convert_SevenDayYield() { // Arrange var message = "AAPL,"; var fields = new[] { DynamicFieldset.Symbol }; // Act for (int i = 0; i < 5; i++) { var sw = Stopwatch.StartNew(); for (int j = 0; j < 1000000; j++) { var dynamicFields = Level1DynamicFields.Parse(message, fields); } sw.Stop(); Console.WriteLine(sw.Elapsed.TotalMilliseconds); } }
protected override void ProcessUpdateMessage(string msg) { var dynamicFields = Level1DynamicFields.Parse(msg, _dynamicFieldsets); Update?.Invoke(new UpdateSummaryDynamicMessage(dynamicFields)); }
public UpdateSummaryDynamicMessage(Level1DynamicFields dynamicFields) { DynamicFields = dynamicFields; }