public void TestBasics()
        {
            var config = new RollbarInfrastructureConfig();

            Console.WriteLine(config.TraceAsString());

            var results = config.Validate();

            Assert.AreEqual(1, results.Count, "One Validation Rule failed!");
            Console.WriteLine("Validation Results:");
            foreach (var result in results)
            {
                Console.WriteLine($"  {result}");
            }
            Console.WriteLine();
        }
Пример #2
0
        /// <summary>
        /// Loads the application settings.
        /// </summary>
        /// <param name="config">The configuration.</param>
        /// <param name="rollbarConfigSection">The application settings.</param>
        /// <returns>false when the configuration was not found, otherwise true.</returns>
        public static bool LoadAppSettings(RollbarInfrastructureConfig config, RollbarConfigSection?rollbarConfigSection)
        {
            if (rollbarConfigSection == null)
            {
                return(false);
            }

            LoadInfrastructureOptions(config, rollbarConfigSection);
            LoadOfflinePayloadStoreOptions(config, rollbarConfigSection);
            LoadDestinationOptions(config, rollbarConfigSection);
            LoadDeveloperOptions(config, rollbarConfigSection);
            LoadHttpProxyOptions(config, rollbarConfigSection);
            LoadDataSecurityOptions(config, rollbarConfigSection);
            LoadTelemetryOptions(config);

            var  validationResults   = config.Validate();
            bool configLoadingResult =
                (validationResults == null) || (validationResults.Count == 0);

            Debug.Assert(configLoadingResult);
            return(configLoadingResult);
        }