Пример #1
0
        public void Options_All_Test()
        {
            IQuantConfig optBuild = new QuantConfig();

            QuantConnectionOption opt = optBuild.Options();

            Assert.AreEqual(opt.ClientId, "TestApp");
            Assert.AreEqual(opt.ClusterId, "hqw6001");
            Assert.AreEqual(opt.StanOptions.NatsURL, "nats://localhost:4222");
            Assert.AreEqual(opt.StanOptions.DiscoverPrefix, "_TEST");
            Assert.AreEqual(opt.StanSubscriptionOptions.DurableName, "RothschildTest-1");
        }
Пример #2
0
 public void Options_EmptyConfig_Test()
 {
     try
     {
         IQuantConfig optBuild = new QuantConfig(
             new ConfigurationBuilder()
             .AddJsonFile($"appsettings.empty.json", optional: true)
             .Build());
         QuantConnectionOption opt = optBuild.Options();
     }
     catch (QuantNotSetAppsettingParException e)
     {
         Assert.IsTrue(true);
     }
 }
Пример #3
0
        public void Options_Default_StanOptions_Test()
        {
            IQuantConfig optBuild = new QuantConfig(
                new ConfigurationBuilder()
                .AddJsonFile($"appsettings.default.json", optional: true)
                .Build());

            QuantConnectionOption opt = optBuild.Options();

            // Default
            Assert.AreEqual(opt.StanOptions.NatsURL, "nats://localhost:4222");
            Assert.AreEqual(opt.StanOptions.DiscoverPrefix, "_STAN.discover");

            Assert.AreEqual(opt.ClientId, "TestApp");
            Assert.AreEqual(opt.ClusterId, "hqw6001");
            Assert.AreEqual(opt.StanOptions.NatsURL, "nats://localhost:4222");
        }
Пример #4
0
        public void Options_QueueGroup_Equals_Test()
        {
            try
            {
                IQuantConfig optBuild = new QuantConfig(
                    new ConfigurationBuilder()
                    .AddJsonFile($"appsettings.localhost.json", optional: true)
                    .Build());
                QuantConnectionOption opt = optBuild.Options();

                Assert.AreEqual(opt.QueueGroup, "RothschildTest-1");
                Assert.AreEqual(opt.StanSubscriptionOptions.DurableName, "RothschildTest-1");
            }
            catch (QuantQueueGroupNotEqualsException e)
            {
                Assert.IsTrue(true);
            }
            catch (Exception e)
            {
                Assert.IsTrue(false);
            }
        }