Ejemplo n.º 1
0
        public void Lookup_SymbolTicker3_LookA()
        {
            test = new FinancialSecurityManager(idParser, lookupServices, combiner, false, false, cache);
            // lookup security data by security id
            // (securityId = "A", so it is a NYSE)
            SecurityData data = test.Lookup("A");

            CheckData_SymbolTicker1_LookA(data, "A");

            // first we check the number of elements in  the cache.
            Assert.AreEqual(3, cache.GetCache().Count, "The cache should only have 3 element.");

            // check the cache key : A
            Object record     = cache["A"];
            bool   isLookedUp = (bool)AccuracyTestsTestHelper.getPropertyField(record, "IsLookedUp");

            Assert.IsTrue(isLookedUp, "The IsLookedUp tag should be set well");
            SecurityData recordData = (SecurityData)AccuracyTestsTestHelper.getPropertyField(record, "SecurityData");

            CheckData_SymbolTicker1_LookA(recordData, "A");

            // check the cache key : B
            record     = cache["B"];
            isLookedUp = (bool)AccuracyTestsTestHelper.getPropertyField(record, "IsLookedUp");
            Assert.IsFalse(isLookedUp, "The IsLookedUp tag should be set well");
            recordData = (SecurityData)AccuracyTestsTestHelper.getPropertyField(record, "SecurityData");
            CheckData_SymbolTicker1_LookA(recordData, "B");

            // check the cache key : C
            record     = cache["C"];
            isLookedUp = (bool)AccuracyTestsTestHelper.getPropertyField(record, "IsLookedUp");
            Assert.IsFalse(isLookedUp, "The IsLookedUp tag should be set well");
            recordData = (SecurityData)AccuracyTestsTestHelper.getPropertyField(record, "SecurityData");
            CheckData_SymbolTicker1_LookA(recordData, "C");
        }
Ejemplo n.º 2
0
        public void Lookup_SymbolTicker1_LookAAndB()
        {
            // lookup security data by security id
            // (securityId = "A", so it is a NYSE)
            test.Lookup("A");
            SecurityData data = test.Lookup("B");

            CheckData_SymbolTicker1_LookAAndB(data, "B");

            // first we check the number of elements in  the cache.
            Assert.AreEqual(4, cache.GetCache().Count, "The cache should only have 4 element.");

            // check the cache key : A
            Object record     = cache["A"];
            bool   isLookedUp = (bool)AccuracyTestsTestHelper.getPropertyField(record, "IsLookedUp");

            Assert.IsTrue(isLookedUp, "The IsLookedUp tag should be set well");
            SecurityData recordData = (SecurityData)AccuracyTestsTestHelper.getPropertyField(record, "SecurityData");

            CheckData_SymbolTicker1_LookAAndB(recordData, "A");

            // check the cache key : B
            record     = cache["B"];
            isLookedUp = (bool)AccuracyTestsTestHelper.getPropertyField(record, "IsLookedUp");
            Assert.IsTrue(isLookedUp, "The IsLookedUp tag should be set well");
            recordData = (SecurityData)AccuracyTestsTestHelper.getPropertyField(record, "SecurityData");
            CheckData_SymbolTicker1_LookAAndB(recordData, "B");

            // check the cache key : C
            record     = cache["C"];
            isLookedUp = (bool)AccuracyTestsTestHelper.getPropertyField(record, "IsLookedUp");
            Assert.IsFalse(isLookedUp, "The IsLookedUp tag should be set well");
            recordData = (SecurityData)AccuracyTestsTestHelper.getPropertyField(record, "SecurityData");
            CheckData_SymbolTicker1_LookAAndB(recordData, "C");

            //  check the cache key : D
            record     = cache["D"];
            isLookedUp = (bool)AccuracyTestsTestHelper.getPropertyField(record, "IsLookedUp");
            Assert.IsFalse(isLookedUp, "The IsLookedUp tag should be set well");
            recordData = (SecurityData)AccuracyTestsTestHelper.getPropertyField(record, "SecurityData");
            CheckData_SymbolTicker1_LookAAndB(recordData, "D");
        }