public void MergeOverwritesOld()
        {
            var env    = EnvironmentBlock.CreateSystemDefault();
            var newEnv = EnvironmentBlock.Create(new Hashtable {
                { "TMP", "FOOBAR" }
            });
            var dict = env.Merge(newEnv).ToDictionary();

            Assert.Equal(env.ToDictionary().Count, dict.Count);
            Assert.Equal("FOOBAR", dict["TMP"]);
        }
        public void GeneratesDefaultEnvironment()
        {
            var env  = EnvironmentBlock.CreateSystemDefault();
            var dict = env.ToDictionary();

            Assert.True(dict.Count > 0);
            // Verify some of the environment variables we expect to be there by default
            Assert.Contains("TEMP", dict.Keys);
            Assert.Contains("TMP", dict.Keys);
            Assert.Contains("SystemRoot", dict.Keys);

            foreach (var key in EnvironmentBlock.ForbiddenEnvironmentVariables)
            {
                Assert.DoesNotContain(key, dict.Keys);
            }
        }