Exemplo n.º 1
0
        public void LoadsConfigurationFromMachineConfigFile()
        {
            var sut = new NetConfigManager();

            Configuration config = sut.LoadFromMachineConfiguration();

            config.EvaluationContext.IsMachineLevel.ShouldBeTrue();
        }
Exemplo n.º 2
0
        public void LoadsConfigurationFromExeConfigFile()
        {
            var sut = new NetConfigManager();

            Configuration config = sut.LoadFromFile(GetPath("WithConnectionString.exe.config"));

            config.ConnectionStrings.ConnectionStrings[0].ConnectionString.ShouldBe("From App Config");
        }
Exemplo n.º 3
0
        public void AddsConfigExtensionWhenNoExtensionIsSpecified()
        {
            var sut = new NetConfigManager();

            Configuration config = sut.LoadFromFile(GetPath("WithConnectionString.exe"));

            config.ConnectionStrings.ConnectionStrings[0].ConnectionString.ShouldBe("From App Config");
        }
Exemplo n.º 4
0
        private void btnConfig_Click(object sender, EventArgs e)
        {
            pnRight.Controls.Clear();
            NetConfigManager frmConfig = new NetConfigManager();

            frmConfig.Dock     = DockStyle.Fill;
            frmConfig.TopLevel = false;
            this.pnRight.Controls.Clear();
            this.pnRight.Controls.Add(frmConfig);
            frmConfig.Show();
        }
Exemplo n.º 5
0
        public void ThrowsIfPathDoesNotExist()
        {
            var sut = new NetConfigManager();

            sut.LoadFromFile(GetPath("FileDoesNotExist.config"));
        }
Exemplo n.º 6
0
        public void ThrowsIfNullPath()
        {
            var sut = new NetConfigManager();

            sut.LoadFromFile(null);
        }
        public void ThrowsIfPathDoesNotExist()
        {
            var sut = new NetConfigManager();

            Assert.Throws <ArgumentException>(() => sut.LoadFromFile(GetPath("FileDoesNotExist.config")));
        }
        public void ThrowsIfNullPath()
        {
            var sut = new NetConfigManager();

            Assert.Throws <ArgumentException>(() => sut.LoadFromFile(null));
        }