public void WriteConfiguration2Test()
        {
            var config = new AutoConfigFile2Configuration();

            // not necesary since constructor calls internally
            //config.Initialize();

            config.MaxDisplayListItems         = 12;
            config.DebugMode                   = DebugModes.DeveloperErrorMessage;
            config.ApplicationName             = "Changed";
            config.SendAdminEmailConfirmations = true;
            config.Write();

            string text = File.ReadAllText(TestHelpers.GetTestConfigFilePath());

            Console.WriteLine(text);

            Assert.IsTrue(text.Contains(@"<add key=""DebugMode"" value=""DeveloperErrorMessage"" />"));
            Assert.IsTrue(text.Contains(@"<add key=""MaxDisplayListItems"" value=""12"" />"));
            Assert.IsTrue(text.Contains(@"<add key=""SendAdminEmailConfirmations"" value=""True"" />"));

            // reset to default val
            config.MaxDisplayListItems = 15;
            config.Write();
        }
        public void DefaultConstructor2InstanceTest()
        {
            var config = new AutoConfigFile2Configuration();

            // Not required since custom constructor calls this
            //config.Initialize();

            Assert.IsNotNull(config);
            Assert.IsFalse(string.IsNullOrEmpty(config.ApplicationName));
            Assert.AreEqual(config.MaxDisplayListItems, 15);

            string text = File.ReadAllText(TestHelpers.GetTestConfigFilePath());
            Console.WriteLine(text);
        }
        public void DefaultConstructor2InstanceTest()
        {
            var config = new AutoConfigFile2Configuration();

            // Not required since custom constructor calls this
            //config.Initialize();

            Assert.IsNotNull(config);
            Assert.IsFalse(string.IsNullOrEmpty(config.ApplicationName));
            Assert.AreEqual(config.MaxDisplayListItems, 15);

            string text = File.ReadAllText(TestHelpers.GetTestConfigFilePath());

            Console.WriteLine(text);
        }
        public void WriteConfiguration2Test()
        {
            var config = new AutoConfigFile2Configuration();

            // not necesary since constructor calls internally
            //config.Initialize();

            config.MaxDisplayListItems = 12;
            config.DebugMode = DebugModes.DeveloperErrorMessage;
            config.ApplicationName = "Changed";
            config.SendAdminEmailConfirmations = true;
            config.Write();

            string text = File.ReadAllText(TestHelpers.GetTestConfigFilePath());
            Console.WriteLine(text);

            Assert.IsTrue(text.Contains(@"<add key=""DebugMode"" value=""DeveloperErrorMessage"" />"));
            Assert.IsTrue(text.Contains(@"<add key=""MaxDisplayListItems"" value=""12"" />"));
            Assert.IsTrue(text.Contains(@"<add key=""SendAdminEmailConfirmations"" value=""True"" />"));

            // reset to default val
            config.MaxDisplayListItems = 15;
            config.Write();
        }