当前位置: 首页>>代码示例>>C#>>正文


C# QuickFix.Dictionary类代码示例

本文整理汇总了C#中QuickFix.Dictionary的典型用法代码示例。如果您正苦于以下问题:C# QuickFix.Dictionary类的具体用法?C# QuickFix.Dictionary怎么用?C# QuickFix.Dictionary使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


QuickFix.Dictionary类属于命名空间,在下文中一共展示了QuickFix.Dictionary类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateConfig

 private static QuickFix.Dictionary CreateConfig()
 {
     QuickFix.Dictionary config = new QuickFix.Dictionary();
     config.SetBool(QuickFix.SessionSettings.PERSIST_MESSAGES, false);
     config.SetString(QuickFix.SessionSettings.CONNECTION_TYPE, "initiator");
     config.SetString(QuickFix.SessionSettings.START_TIME, "00:00:00");
     config.SetString(QuickFix.SessionSettings.END_TIME, "00:00:00");
     return config;
 }
开发者ID:RJPalmer,项目名称:qfn_uidemo,代码行数:9,代码来源:UnitTestContext.cs

示例2: testInvalidTimeZone

        public void testInvalidTimeZone()
        {
            QuickFix.Dictionary settings = new QuickFix.Dictionary();
            settings.SetString(QuickFix.SessionSettings.START_TIME, "06:00:23");
            settings.SetString(QuickFix.SessionSettings.END_TIME, "00:12:00");
            settings.SetString(QuickFix.SessionSettings.TIME_ZONE, "Doh");

            Assert.Throws(typeof (TimeZoneNotFoundException), delegate { new QuickFix.SessionSchedule(settings); });
        }
开发者ID:BobRoss79,项目名称:quickfixn,代码行数:9,代码来源:SessionScheduleTests.cs

示例3: testLocalTimeTimeZoneConflict

        public void testLocalTimeTimeZoneConflict()
        {
            QuickFix.Dictionary settings = new QuickFix.Dictionary();
            settings.SetString(QuickFix.SessionSettings.START_TIME, "06:00:23");
            settings.SetString(QuickFix.SessionSettings.END_TIME, "00:12:00");
            settings.SetString(QuickFix.SessionSettings.TIME_ZONE, "Doh");
            settings.SetString(QuickFix.SessionSettings.USE_LOCAL_TIME, "Y");
            settings.SetString(QuickFix.SessionSettings.TIME_ZONE, "Eastern Standard Time");

            Assert.Throws(typeof (QuickFix.ConfigError), delegate { new QuickFix.SessionSchedule(settings); });
        }
开发者ID:BobRoss79,项目名称:quickfixn,代码行数:11,代码来源:SessionScheduleTests.cs

示例4: testThrowsIfNoConfig

        public void testThrowsIfNoConfig()
        {
            QuickFix.SessionID sessionID = new QuickFix.SessionID("FIX.4.2", "SENDERCOMP", "TARGETCOMP");
            QuickFix.Dictionary config = new QuickFix.Dictionary();
            config.SetString(QuickFix.SessionSettings.CONNECTION_TYPE, "initiator");
            QuickFix.SessionSettings settings = new QuickFix.SessionSettings();
            settings.Set(sessionID, config);

            QuickFix.FileLogFactory factory = new QuickFix.FileLogFactory(settings);

            Assert.Throws<QuickFix.ConfigError>(delegate { factory.Create(sessionID); });
        }
开发者ID:BobRoss79,项目名称:quickfixn,代码行数:12,代码来源:FileLogTests.cs

示例5: testOptArgs

        public void testOptArgs()
        {
            QuickFix.Dictionary settings = new QuickFix.Dictionary();
            settings.SetString(QuickFix.SessionSettings.START_TIME, "00:00:00");
            settings.SetString(QuickFix.SessionSettings.END_TIME, "00:00:00");

            settings.SetDay(QuickFix.SessionSettings.START_DAY, System.DayOfWeek.Thursday);
            Assert.Throws(typeof(QuickFix.ConfigError), delegate { new QuickFix.SessionSchedule(settings); });

            settings.SetDay(QuickFix.SessionSettings.END_DAY, System.DayOfWeek.Friday);
            Assert.DoesNotThrow(delegate { new QuickFix.SessionSchedule(settings); });
        }
开发者ID:nisbus,项目名称:quickfixn,代码行数:12,代码来源:SessionScheduleTests.cs

示例6: testDailyIsSessionTimeAllDay

        public void testDailyIsSessionTimeAllDay()
        {
            QuickFix.Dictionary settings = new QuickFix.Dictionary();
            settings.SetString(QuickFix.SessionSettings.START_TIME, "00:00:00");
            settings.SetString(QuickFix.SessionSettings.END_TIME, "00:00:00");

            QuickFix.SessionSchedule sched = new QuickFix.SessionSchedule(settings);

            Assert.IsTrue(sched.IsSessionTime(new DateTime(2011,10,17,9,43,0)));
            Assert.IsTrue(sched.IsSessionTime(new DateTime(2011,10,18,9,43,0)));
            Assert.IsTrue(sched.IsSessionTime(new DateTime(2011, 10, 18, 0, 0, 0)));
            Assert.IsTrue(sched.IsSessionTime(new DateTime(2011, 10, 18, 23, 59, 59)));
        }
开发者ID:BobRoss79,项目名称:quickfixn,代码行数:13,代码来源:SessionScheduleTests.cs

示例7: testRequiredArgs

        public void testRequiredArgs()
        {
            QuickFix.Dictionary settings = new QuickFix.Dictionary();
            Assert.Throws(typeof(QuickFix.ConfigError), delegate { new QuickFix.SessionSchedule(settings); });

            settings.SetString(QuickFix.SessionSettings.START_TIME, "00:00:00");
            Assert.Throws(typeof(QuickFix.ConfigError), delegate { new QuickFix.SessionSchedule(settings); });

            settings.SetString(QuickFix.SessionSettings.END_TIME, "00:0blkajsdf");
            Assert.Throws(typeof(QuickFix.ConfigError), delegate { new QuickFix.SessionSchedule(settings); });

            settings.SetString(QuickFix.SessionSettings.END_TIME, "00:00:00");
            Assert.DoesNotThrow(delegate { new QuickFix.SessionSchedule(settings); });
        }
开发者ID:nisbus,项目名称:quickfixn,代码行数:14,代码来源:SessionScheduleTests.cs

示例8: testDailyIsSessionTimeWrapAround

        public void testDailyIsSessionTimeWrapAround()
        {
            QuickFix.Dictionary settings = new QuickFix.Dictionary();
            settings.SetString(QuickFix.SessionSettings.START_TIME, "06:00:23");
            settings.SetString(QuickFix.SessionSettings.END_TIME, "00:12:00");

            QuickFix.SessionSchedule sched = new QuickFix.SessionSchedule(settings);

            Assert.IsTrue(sched.IsSessionTime(new DateTime(2011, 10, 17, 6, 0, 23)));
            Assert.IsTrue(sched.IsSessionTime(new DateTime(2011, 10, 17, 8, 43, 0)));
            Assert.IsTrue(sched.IsSessionTime(new DateTime(2011, 10, 18, 0, 12, 00)));

            Assert.IsFalse(sched.IsSessionTime(new DateTime(2011, 10, 18, 0, 12, 1)));
            Assert.IsFalse(sched.IsSessionTime(new DateTime(2011, 10, 18, 6, 0, 22)));
        }
开发者ID:BobRoss79,项目名称:quickfixn,代码行数:15,代码来源:SessionScheduleTests.cs

示例9: testLogRotation

        public void testLogRotation()
        {
            string logDir = "log";
            if (System.IO.Directory.Exists(logDir))
                System.IO.Directory.Delete(logDir, true);

            QuickFix.SessionID sessionID = new QuickFix.SessionID("FIX.4.2", "SENDERCOMP", "TARGETCOMP");
            QuickFix.SessionSettings settings = new QuickFix.SessionSettings();

            QuickFix.Dictionary config = new QuickFix.Dictionary();
            config.SetString(QuickFix.SessionSettings.CONNECTION_TYPE, "initiator");
            config.SetString(QuickFix.SessionSettings.FILE_LOG_PATH, logDir);

            int NumLogsToRotate = 5;
            config.SetString(QuickFix.SessionSettings.FILE_LOG_ROTATE_NUM_TO_KEEP, NumLogsToRotate.ToString());
            config.SetString(QuickFix.SessionSettings.FILE_LOG_ROTATE_ON_NEW_SESSION, "Y");

            settings.Set(sessionID, config);

            string timeStampMinute = System.DateTime.UtcNow.ToString("MMddyyyy-HHmm");

            for (int i = 0; i < NumLogsToRotate; i++)
            {
                QuickFix.FileLogFactory factory = new QuickFix.FileLogFactory(settings);
                log = (QuickFix.FileLog)factory.Create(sessionID);

                log.OnEvent("some event");
                log.OnIncoming("some incoming");
                log.OnOutgoing("some outgoing");

                Assert.That(System.IO.File.Exists(logDir+"/FIX.4.2-SENDERCOMP-TARGETCOMP.event.current.log"));
                Assert.That(System.IO.File.Exists(logDir+"/FIX.4.2-SENDERCOMP-TARGETCOMP.messages.current.log"));
                log.Dispose();

            }

            Assert.That(System.IO.Directory.GetFiles(logDir,
                String.Format("FIX.4.2-SENDERCOMP-TARGETCOMP.messages.current.log.{0}*",timeStampMinute),
                System.IO.SearchOption.TopDirectoryOnly)
                .Count().Equals(NumLogsToRotate-1));

            Assert.That(System.IO.Directory.GetFiles(logDir,
                String.Format("FIX.4.2-SENDERCOMP-TARGETCOMP.event.current.log.{0}*", timeStampMinute),
                System.IO.SearchOption.TopDirectoryOnly)
                .Count().Equals(NumLogsToRotate-1));
        }
开发者ID:mjwood7,项目名称:quickfixn,代码行数:46,代码来源:FileLogTests.cs

示例10: setup

        public void setup()
        {
            if (System.IO.Directory.Exists("store"))
                System.IO.Directory.Delete("store", true);

            sessionID = new QuickFix.SessionID("FIX.4.2", "SENDERCOMP", "TARGETCOMP");

            QuickFix.Dictionary config = new QuickFix.Dictionary();
            config.SetString(QuickFix.SessionSettings.CONNECTION_TYPE, "initiator");
            config.SetString(QuickFix.SessionSettings.FILE_STORE_PATH, "store");

            settings = new QuickFix.SessionSettings();
            settings.Set(sessionID, config);
            factory = new QuickFix.FileStoreFactory(settings);

            store = (QuickFix.FileStore)factory.Create(sessionID);
        }
开发者ID:RemiGaudin,项目名称:quickfixn,代码行数:17,代码来源:FileStoreTests.cs

示例11: testLastEndTime_DailySessions

        public void testLastEndTime_DailySessions()
        {
            QuickFix.Dictionary settings = new QuickFix.Dictionary();
            settings.SetString(QuickFix.SessionSettings.START_TIME, "09:30:00");
            settings.SetString(QuickFix.SessionSettings.END_TIME, "16:00:00");
            QuickFix.SessionSchedule sched = new QuickFix.SessionSchedule(settings);

            DateTime thisDayEnd = new DateTime(2012, 10, 18, 16, 00, 00, DateTimeKind.Utc);
            DateTime prevDayEnd = new DateTime(2012, 10, 17, 16, 00, 00, DateTimeKind.Utc);

            // before starttime
            Assert.AreEqual(prevDayEnd, sched.LastEndTime(new DateTime(2012, 10, 18, 08, 00, 00, DateTimeKind.Utc)));
            // during session
            Assert.AreEqual(prevDayEnd, sched.LastEndTime(new DateTime(2012, 10, 18, 08, 00, 00, DateTimeKind.Utc)));
            // equals endtime
            Assert.AreEqual(thisDayEnd, sched.LastEndTime(thisDayEnd));
            // after endtime
            Assert.AreEqual(thisDayEnd, sched.LastEndTime(new DateTime(2012, 10, 18, 17, 00, 00, DateTimeKind.Utc)));

            // ==========
            // Settings file is specified in a zone (est, -5)
            settings = new QuickFix.Dictionary();
            settings.SetString(QuickFix.SessionSettings.START_TIME, "04:30:00"); // 09:30:00 utc
            settings.SetString(QuickFix.SessionSettings.END_TIME, "11:00:00");   // 16:00:00 utc
            settings.SetString(QuickFix.SessionSettings.TIME_ZONE, "Eastern Standard Time"); //-5
            sched = new QuickFix.SessionSchedule(settings);

            // before starttime
            Assert.AreEqual(prevDayEnd, sched.LastEndTime(new DateTime(2012, 10, 18, 08, 00, 00, DateTimeKind.Utc)));
            // during session
            Assert.AreEqual(prevDayEnd, sched.LastEndTime(new DateTime(2012, 10, 18, 10, 00, 00, DateTimeKind.Utc)));
            // equals endtime
            Assert.AreEqual(thisDayEnd, sched.LastEndTime(thisDayEnd));
            // after endtime
            Assert.AreEqual(thisDayEnd, sched.LastEndTime(new DateTime(2012, 10, 18, 17, 00, 00, DateTimeKind.Utc)));
        }
开发者ID:atesio,项目名称:quickfixn,代码行数:36,代码来源:SessionScheduleTests.cs

示例12: testGeneratedFileName

        public void testGeneratedFileName()
        {
            if (System.IO.Directory.Exists("log"))
                System.IO.Directory.Delete("log", true);

            QuickFix.SessionID sessionID = new QuickFix.SessionID("FIX.4.2", "SENDERCOMP", "TARGETCOMP");
            QuickFix.SessionSettings settings = new QuickFix.SessionSettings();

            QuickFix.Dictionary config = new QuickFix.Dictionary();
            config.SetString(QuickFix.SessionSettings.CONNECTION_TYPE, "initiator");
            config.SetString(QuickFix.SessionSettings.FILE_LOG_PATH, "log");

            settings.Set(sessionID, config);

            QuickFix.FileLogFactory factory = new QuickFix.FileLogFactory(settings);
            log = (QuickFix.FileLog)factory.Create(sessionID);

            log.OnEvent("some event");
            log.OnIncoming("some incoming");
            log.OnOutgoing("some outgoing");

            Assert.That(System.IO.File.Exists("log/FIX.4.2-SENDERCOMP-TARGETCOMP.event.current.log"));
            Assert.That(System.IO.File.Exists("log/FIX.4.2-SENDERCOMP-TARGETCOMP.messages.current.log"));
        }
开发者ID:BobRoss79,项目名称:quickfixn,代码行数:24,代码来源:FileLogTests.cs

示例13: testWeeklySessionSameDayOneDay

        public void testWeeklySessionSameDayOneDay()
        {
            QuickFix.Dictionary settings = new QuickFix.Dictionary();
            settings.SetString(QuickFix.SessionSettings.START_TIME, "00:00:00");
            settings.SetString(QuickFix.SessionSettings.END_TIME, "05:00:00");

            settings.SetDay(QuickFix.SessionSettings.START_DAY, System.DayOfWeek.Monday);
            settings.SetDay(QuickFix.SessionSettings.END_DAY, System.DayOfWeek.Monday);
            QuickFix.SessionSchedule sched = new QuickFix.SessionSchedule(settings);

            //a sunday
            Assert.IsFalse(sched.IsSessionTime(new DateTime(2011, 10, 16, 23, 59, 59)));
            Assert.IsFalse(sched.IsSessionTime(new DateTime(2011, 10, 16, 0, 0, 0)));

            //a monday
            Assert.IsTrue(sched.IsSessionTime(new DateTime(2011, 10, 17, 0, 0, 1)));
            Assert.IsTrue(sched.IsSessionTime(new DateTime(2011, 10, 17, 4, 0, 1)));
            Assert.IsFalse(sched.IsSessionTime(new DateTime(2011, 10, 17, 6, 59, 59)));

            //a tuesday
            Assert.IsFalse(sched.IsSessionTime(new DateTime(2011, 10, 18, 9, 43, 0)));
            Assert.IsFalse(sched.IsSessionTime(new DateTime(2011, 10, 18, 0, 0, 0)));
        }
开发者ID:BobRoss79,项目名称:quickfixn,代码行数:23,代码来源:SessionScheduleTests.cs

示例14: testWeeklySessionMultiDayOverlap

        public void testWeeklySessionMultiDayOverlap()
        {
            QuickFix.Dictionary settings = new QuickFix.Dictionary();
            settings.SetString(QuickFix.SessionSettings.START_TIME, "00:00:00");
            settings.SetString(QuickFix.SessionSettings.END_TIME, "00:00:00");

            //only on wed-sunday night
            settings.SetDay(QuickFix.SessionSettings.START_DAY, System.DayOfWeek.Wednesday);
            settings.SetDay(QuickFix.SessionSettings.END_DAY, System.DayOfWeek.Monday);

            QuickFix.SessionSchedule sched = new QuickFix.SessionSchedule(settings);

            //wed-monday
            Assert.IsTrue(sched.IsSessionTime(new DateTime(2011, 10, 19, 9, 43, 0)));
            Assert.IsTrue(sched.IsSessionTime(new DateTime(2011, 10, 20, 9, 43, 0)));
            Assert.IsTrue(sched.IsSessionTime(new DateTime(2011, 10, 21, 9, 43, 0)));
            Assert.IsTrue(sched.IsSessionTime(new DateTime(2011, 10, 22, 9, 43, 0)));
            Assert.IsTrue(sched.IsSessionTime(new DateTime(2011, 10, 16, 9, 43, 0)));

            //monday
            Assert.IsFalse(sched.IsSessionTime(new DateTime(2011, 10, 17, 9, 43, 0)));

            //tuesday
            Assert.IsFalse(sched.IsSessionTime(new DateTime(2011, 10, 18, 9, 43, 0)));
        }
开发者ID:BobRoss79,项目名称:quickfixn,代码行数:25,代码来源:SessionScheduleTests.cs

示例15: testWeeklySessionMultiDayHoursOverlap

        public void testWeeklySessionMultiDayHoursOverlap()
        {
            QuickFix.Dictionary settings = new QuickFix.Dictionary();
            settings.SetString(QuickFix.SessionSettings.START_TIME, "15:00:00");
            settings.SetString(QuickFix.SessionSettings.END_TIME, "07:00:00");

            //only on monday-fri
            settings.SetDay(QuickFix.SessionSettings.START_DAY, System.DayOfWeek.Monday);
            settings.SetDay(QuickFix.SessionSettings.END_DAY, System.DayOfWeek.Friday);

            QuickFix.SessionSchedule sched = new QuickFix.SessionSchedule(settings);

            //weekdays
            Assert.IsTrue(sched.IsSessionTime(new DateTime(2011, 10, 17, 15, 30, 0)));
            Assert.IsFalse(sched.IsSessionTime(new DateTime(2011, 10, 17, 6, 30, 0)),"foo");

            Assert.IsTrue(sched.IsSessionTime(new DateTime(2011, 10, 21, 5, 30, 59)));
            Assert.IsFalse(sched.IsSessionTime(new DateTime(2011, 10, 21, 15, 30, 59)));
            Assert.IsFalse(sched.IsSessionTime(new DateTime(2011, 10, 22, 6, 59, 59)));
            Assert.IsFalse(sched.IsSessionTime(new DateTime(2011, 10, 22, 7, 00, 1)));
            Assert.IsFalse(sched.IsSessionTime(new DateTime(2011, 10, 22, 15, 30, 0)));
        }
开发者ID:BobRoss79,项目名称:quickfixn,代码行数:22,代码来源:SessionScheduleTests.cs


注:本文中的QuickFix.Dictionary类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。