Пример #1
0
        public void TestTemplateValueLookup()
        {
            IDictionary dictionary = new TemplateDictionary();
            Group       template   = new MessageTemplate(
                "Position",
                new Field[]
            {
                new Scalar("exchange", FastType.String, Operator.Copy, ScalarValue.Undefined, false)
            });
            ScalarValue value = new StringValue("NYSE");

            dictionary.Store(template, new QName("exchange"), FastConstants.AnyType, value);

            Assert.AreEqual(value, dictionary.Lookup(template, new QName("exchange"), FastConstants.AnyType));

            Group quoteTemplate = new MessageTemplate(
                "Quote",
                new Field[]
            {
                new Scalar("bid", FastType.Decimal, Operator.Delta, ScalarValue.Undefined, false)
            });

            Assert.AreEqual(ScalarValue.Undefined,
                            dictionary.Lookup(quoteTemplate, new QName("exchange"), FastConstants.AnyType));
        }
Пример #2
0
        public void TestLookupMultipleValuesForTemplate()
        {
            Dictionary dictionary = new TemplateDictionary();
            Group      template   = new MessageTemplate("Position",
                                                        new Field[] {
                new Scalar("exchange", FASTType.STRING, Operator.COPY, ScalarValue.UNDEFINED, false)
            });
            ScalarValue value       = new StringValue("NYSE");
            ScalarValue marketValue = new DecimalValue(100000.00);

            dictionary.Store(template, FastConstants.ANY_TYPE, new QName("exchange"), value);
            dictionary.Store(template, FastConstants.ANY_TYPE, new QName("marketValue"), marketValue);

            Assert.IsFalse(value.Equals(ScalarValue.UNDEFINED));
            Assert.AreEqual(value, dictionary.Lookup(template, new QName("exchange"), FastConstants.ANY_TYPE));
            Assert.AreEqual(marketValue, dictionary.Lookup(template, new QName("marketValue"), FastConstants.ANY_TYPE));
        }
        public void TestLookupMultipleValuesForTemplate()
        {
            IDictionary dictionary = new TemplateDictionary();
            Group template = new MessageTemplate(
                "Position",
                new Field[]
                    {
                        new Scalar("exchange", FastType.String, Operator.Copy, ScalarValue.Undefined, false)
                    });
            ScalarValue value = new StringValue("NYSE");
            ScalarValue marketValue = new DecimalValue(100000.00);
            dictionary.Store(template, new QName("exchange"), FastConstants.AnyType, value);
            dictionary.Store(template, new QName("marketValue"), FastConstants.AnyType, marketValue);

            Assert.AreNotEqual(ScalarValue.Undefined, value);
            Assert.AreEqual(value, dictionary.Lookup(template, new QName("exchange"), FastConstants.AnyType));
            Assert.AreEqual(marketValue, dictionary.Lookup(template, new QName("marketValue"), FastConstants.AnyType));
        }
Пример #4
0
        public void TestLookupMultipleValuesForTemplate()
        {
            IDictionary dictionary = new TemplateDictionary();
            Group       template   = new MessageTemplate(
                "Position",
                new Field[]
            {
                new Scalar("exchange", FastType.String, Operator.Copy, ScalarValue.Undefined, false)
            });
            ScalarValue value       = new StringValue("NYSE");
            ScalarValue marketValue = new DecimalValue(100000.00);

            dictionary.Store(template, new QName("exchange"), FastConstants.AnyType, value);
            dictionary.Store(template, new QName("marketValue"), FastConstants.AnyType, marketValue);

            Assert.AreNotEqual(ScalarValue.Undefined, value);
            Assert.AreEqual(value, dictionary.Lookup(template, new QName("exchange"), FastConstants.AnyType));
            Assert.AreEqual(marketValue, dictionary.Lookup(template, new QName("marketValue"), FastConstants.AnyType));
        }
Пример #5
0
        public void TestExistingTemplateValueLookup()
        {
            Dictionary dictionary = new TemplateDictionary();
            Group      template   = new MessageTemplate("Position",
                                                        new Field[] {
                new Scalar("exchange", FASTType.STRING, Operator.COPY, ScalarValue.UNDEFINED, false)
            });
            ScalarValue value = new StringValue("NYSE");

            dictionary.Store(template, FastConstants.ANY_TYPE, new QName("exchange"), value);

            Assert.AreEqual(ScalarValue.UNDEFINED, dictionary.Lookup(template, new QName("bid"), FastConstants.ANY_TYPE));
        }
        public void TestExistingTemplateValueLookup()
        {
            IDictionary dictionary = new TemplateDictionary();
            Group template = new MessageTemplate(
                "Position",
                new Field[]
                    {
                        new Scalar("exchange", FastType.String, Operator.Copy, ScalarValue.Undefined, false)
                    });
            ScalarValue value = new StringValue("NYSE");
            dictionary.Store(template, new QName("exchange"), FastConstants.AnyType, value);

            Assert.AreEqual(ScalarValue.Undefined, dictionary.Lookup(template, new QName("bid"), FastConstants.AnyType));
        }