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_BidTime()
        {
            // Arrange
            var message = $"Q,DONT_CARE_SYMBOL,{TimeSpanStringValue}";
            var fields  = new[] { DynamicFieldset.Symbol, DynamicFieldset.BidTime };

            // Act
            var dynamicFields = Level1DynamicFields.Parse(message, fields);

            // Assert
            Assert.AreEqual(dynamicFields.BidTime, _timeSpanValue);
        }
        public void Should_Convert_CloseRange2()
        {
            // Arrange
            var message = $"Q,DONT_CARE_SYMBOL,{DoubleValue}";
            var fields  = new[] { DynamicFieldset.Symbol, DynamicFieldset.CloseRange2 };

            // Act
            var dynamicFields = Level1DynamicFields.Parse(message, fields);

            // Assert
            Assert.AreEqual(dynamicFields.CloseRange2, DoubleValue);
        }
        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_BidSize()
        {
            // Arrange
            var message = $"Q,DONT_CARE_SYMBOL,{IntegerValue}";
            var fields  = new[] { DynamicFieldset.Symbol, DynamicFieldset.BidSize };

            // Act
            var dynamicFields = Level1DynamicFields.Parse(message, fields);

            // Assert
            Assert.AreEqual(dynamicFields.BidSize, IntegerValue);
        }
        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_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_PriceEarningsRatio()
        {
            // Arrange
            var message = $"Q,DONT_CARE_SYMBOL,{DoubleValue}";
            var fields  = new[] { DynamicFieldset.Symbol, DynamicFieldset.PriceEarningsRatio };

            // Act
            var dynamicFields = Level1DynamicFields.Parse(message, fields);

            // Assert
            Assert.AreEqual(dynamicFields.PriceEarningsRatio, 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_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_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);
        }
Exemplo n.º 15
0
        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);
            }
        }
Exemplo n.º 16
0
        protected override void ProcessUpdateMessage(string msg)
        {
            var dynamicFields = Level1DynamicFields.Parse(msg, _dynamicFieldsets);

            Update?.Invoke(new UpdateSummaryDynamicMessage(dynamicFields));
        }