public void Should_be_able_to_load_the_configuration()
        {
            var path    = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ".config\\McAfee.config");
            var section = ConfigurationSectionProvider.OpenFile <McAfeeSection>("shuttle", "mcafee", path);

            Assert.That(section, Is.Not.Null);
            Assert.That(section.Url, Is.EqualTo("api-url"));
            Assert.That(section.Username, Is.EqualTo("api-username"));
            Assert.That(section.Password, Is.EqualTo("api-password"));
            Assert.That(section.SessionDuration, Is.EqualTo("00:00:05"));
            Assert.That(section.AnalyzerProfile, Is.EqualTo("analyzer-profile"));
            Assert.That(section.AcceptableSeverity, Is.EqualTo(3));
            Assert.That(section.HeartbeatInterval, Is.EqualTo("00:00:10"));
            Assert.That(section.PollScanInterval, Is.EqualTo("00:00:15"));

            var configuration = McAfeeSection.Configuration(path);

            Assert.That(configuration.Url, Is.EqualTo("api-url"));
            Assert.That(configuration.Username, Is.EqualTo("api-username"));
            Assert.That(configuration.Password, Is.EqualTo("api-password"));
            Assert.That(configuration.SessionDuration, Is.EqualTo(TimeSpan.FromSeconds(5)));
            Assert.That(configuration.AnalyzerProfile, Is.EqualTo("analyzer-profile"));
            Assert.That(configuration.AcceptableSeverity, Is.EqualTo(3));
            Assert.That(configuration.HeartbeatInterval, Is.EqualTo(TimeSpan.FromSeconds(10)));
            Assert.That(configuration.PollScanInterval, Is.EqualTo(TimeSpan.FromSeconds(15)));
        }
        public void Should_be_able_to_load_the_configuration(string file)
        {
            var section = ConfigurationSectionProvider.OpenFile <CorruptTransportMessageSection>("shuttle", "corruptTransportMessage",
                                                                                                 Path.Combine(AppDomain.CurrentDomain.BaseDirectory, string.Format(@"config-files\{0}", file)));

            Assert.IsNotNull(section);
            Assert.AreEqual(".\\folder", section.Folder);
        }
        public void Should_be_able_to_load_the_configuration()
        {
            var section = ConfigurationSectionProvider.OpenFile <OpswatSection>("shuttle", "opswat",
                                                                                Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ".config\\Opswat.config"));

            Assert.That(section, Is.Not.Null);
            Assert.That(section.ApiKey, Is.EqualTo("api-key"));
            Assert.That(section.ApiUrl, Is.EqualTo("api-url"));
        }
        public void Should_be_able_to_load_the_configuration(string file)
        {
            var section = ConfigurationSectionProvider.OpenFile <ActiveTimeRangeSection>("shuttle", "activeTimeRange",
                                                                                         Path.Combine(AppDomain.CurrentDomain.BaseDirectory, string.Format(@"config-files\{0}", file)));

            Assert.IsNotNull(section);
            Assert.AreEqual("8:00", section.From);
            Assert.AreEqual("23:00", section.To);
        }
Пример #5
0
        public void Should_be_able_to_load_the_configuration(string file)
        {
            var section = ConfigurationSectionProvider.OpenFile <ServiceHostSection>("shuttle", "service",
                                                                                     Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $@"config-files\{file}"));

            Assert.IsNotNull(section);
            Assert.AreEqual("test-service", section.ServiceName);
            Assert.AreEqual("one", section.Instance);
            Assert.AreEqual("mr.resistor", section.Username);
            Assert.AreEqual("ohm", section.Password);
            Assert.AreEqual(ServiceStartMode.Disabled, section.StartMode);
        }
Пример #6
0
        public void Should_be_able_to_load_the_configuration(string file)
        {
            var section = ConfigurationSectionProvider.OpenFile <PurgeQueuesSection>("shuttle", "purgeQueues",
                                                                                     Path.Combine(AppDomain.CurrentDomain.BaseDirectory, string.Format(@"config-files\{0}", file)));

            Assert.IsNotNull(section);
            Assert.AreEqual(2, section.Queues.Count);

            foreach (PurgeQueueElement element in section.Queues)
            {
                Console.WriteLine(element.Uri);
            }
        }
        public void Should_be_able_to_load_the_configuration(string file)
        {
            var section = ConfigurationSectionProvider.OpenFile <MessageForwardingSection>("shuttle", "messageForwarding",
                                                                                           Path.Combine(AppDomain.CurrentDomain.BaseDirectory, string.Format(@"config-files\{0}", file)));

            Assert.IsNotNull(section);
            Assert.AreEqual(2, section.ForwardingRoutes.Count);

            foreach (MessageRouteElement map in section.ForwardingRoutes)
            {
                Console.WriteLine(map.Uri);

                foreach (SpecificationElement specification in map)
                {
                    Console.WriteLine(@"-> {0} - {1}", specification.Name, specification.Value);
                }

                Console.WriteLine();
            }
        }
Пример #8
0
 public static IMcAfeeConfiguration Configuration(string path)
 {
     return(Configuration(ConfigurationSectionProvider.OpenFile <McAfeeSection>("shuttle", "mcafee", path)));
 }
Пример #9
0
 private EventStoreSection Open(string file)
 {
     return(ConfigurationSectionProvider.OpenFile <EventStoreSection>("shuttle", "eventStore",
                                                                      Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $@".\Section\files\{file}")));
 }
Пример #10
0
 protected MsmqSection GetMsmqSection(string file)
 {
     return(ConfigurationSectionProvider.OpenFile <MsmqSection>("shuttle", "msmq",
                                                                Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $@"MsmqSection\files\{file}")));
 }
Пример #11
0
 protected ServiceBusSection GetServiceBusSection(string file)
 {
     return(ConfigurationSectionProvider.OpenFile <ServiceBusSection>("shuttle", "serviceBus",
                                                                      Path.Combine(AppDomain.CurrentDomain.BaseDirectory,
                                                                                   string.Format(@".\ServiceBusSection\files\{0}", file))));
 }
 private BootstrapSection GetSection(string file)
 {
     return(ConfigurationSectionProvider.OpenFile <BootstrapSection>("shuttle", "bootstrap",
                                                                     Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $@".\Container\files\{file}")));
 }
 private TransactionScopeSection Open(string file)
 {
     return(ConfigurationSectionProvider.OpenFile <TransactionScopeSection>("shuttle", "transactionScope",
                                                                            Path.Combine(AppDomain.CurrentDomain.BaseDirectory, string.Format(@".\TransactionScopeSection\files\{0}", file))));
 }
 protected NetMQServerSection GetNetMQServerSection(string file)
 {
     return(ConfigurationSectionProvider.OpenFile <NetMQServerSection>("shuttle", "netmq",
                                                                       Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $@".\.files\{file}")));
 }
Пример #15
0
 protected AmazonSqsSection GetAmazonSqsSection(string file)
 {
     return(ConfigurationSectionProvider.OpenFile <AmazonSqsSection>("shuttle", "amazonsqs",
                                                                     Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $@".\files\{file}")));
 }
Пример #16
0
 protected T GetSection <T>(string name, string file) where T : class
 {
     return(ConfigurationSectionProvider.OpenFile <T>("shuttle", name,
                                                      Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $@".\Configuration\files\{file}")));
 }
 private ComponentRegistrySection GetSection(string file)
 {
     return(ConfigurationSectionProvider.OpenFile <ComponentRegistrySection>("shuttle", "componentRegistry",
                                                                             Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $@".\Container\files\{file}")));
 }
Пример #18
0
 private TripleDesSection GetSection(string file)
 {
     return(ConfigurationSectionProvider.OpenFile <TripleDesSection>("shuttle", "tripleDes",
                                                                     Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $@".\files\{file}")));
 }
Пример #19
0
 protected RabbitMQSection GetRabbitMQSection(string file)
 {
     return(ConfigurationSectionProvider.OpenFile <RabbitMQSection>("shuttle", "rabbitmq",
                                                                    Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $@".\RabbitMQSection\files\{file}")));
 }
 protected IdempotenceSection GetSection(string file)
 {
     return(ConfigurationSectionProvider.OpenFile <IdempotenceSection>("shuttle", "idempotence", Path.Combine(AppDomain.CurrentDomain.BaseDirectory, string.Format(@".\files\{0}", file))));
 }