コード例 #1
0
        public void Test1()
        {
            var env = EnvManager.Generate("Hello");

            Assert.Equal("Hello", env.Name);
            Assert.True(env.Enabled);
        }
コード例 #2
0
        public void Test1()
        {
            var env = EnvManager.Generate("Hello");

            switcher.TurnOff(env);
            switcher.TurnOn(env);
        }
コード例 #3
0
        public void Test3()
        {
            var env = EnvManager.Generate("Hello");

            Assert.Throws <ArgumentException>(() =>
            {
                switcher.TurnOn(env);
            });
        }
コード例 #4
0
        public void Test2()
        {
            var envName = "Hello";

            Directory.CreateDirectory("Managed");
            var stream = new EnvStream("Managed", envName);

            stream.WriteEnv(EnvManager.Generate(envName));
        }
コード例 #5
0
        public void Test2()
        {
            var env = EnvManager.Generate("Hello");

            env.Enabled = false;
            Assert.Throws <ArgumentException>(() =>
            {
                switcher.TurnOff(env);
            });
        }
コード例 #6
0
        public void Test2()
        {
            var env = EnvManager.Generate("Hello");

            var settings = new ParallelEnvsSettings();

            settings.EnvNames.Add(env.Name);

            EnvManager.AddFile(ref env, existsFilePath, settings);
        }
コード例 #7
0
        public void Test3()
        {
            var env = EnvManager.Generate("Hello");

            var settings = new ParallelEnvsSettings();

            settings.EnvNames.Add(env.Name);

            Assert.Throws <FileNotFoundException>(() =>
            {
                EnvManager.AddFile(ref env, unknownFilePath, settings);
            });
        }
コード例 #8
0
        public void Test3()
        {
            var envName = "Hello";

            Directory.CreateDirectory("Managed");
            var stream = new EnvStream("Managed", envName);

            var env = EnvManager.Generate(envName);

            stream.WriteEnv(env);

            var env_loaded = stream.LoadEnv();

            Assert.Equal(env.Name, env_loaded.Name);
            Assert.True(env.Enabled == env_loaded.Enabled);
            Assert.Equal(env.Files, env_loaded.Files);
        }
コード例 #9
0
        public void Execute(List <string> args)
        {
            if (args.Count == 0)
            {
                Console.WriteLine(Description);
                return;
            }

            var envName = args[0];
            var env     = EnvManager.Generate(envName);

            Settings.EnvNames.Add(env.Name);
            Settings.SaveToFile();

            var stream = new EnvStream(Settings.ApplicationWorkDirectoryPath, env.Name);

            stream.WriteEnv(env);

            Console.WriteLine("Created");
        }