コード例 #1
0
        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");
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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");
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        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);
        }
コード例 #9
0
        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);
        }
コード例 #10
0
        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);
        }
コード例 #11
0
        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);
        }
コード例 #12
0
        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);
        }
コード例 #13
0
        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);
        }
コード例 #14
0
        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);
        }
コード例 #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);
            }
        }
コード例 #16
0
        protected override void ProcessUpdateMessage(string msg)
        {
            var dynamicFields = Level1DynamicFields.Parse(msg, _dynamicFieldsets);

            Update?.Invoke(new UpdateSummaryDynamicMessage(dynamicFields));
        }
コード例 #17
0
 public UpdateSummaryDynamicMessage(Level1DynamicFields dynamicFields)
 {
     DynamicFields = dynamicFields;
 }