Exemplo n.º 1
0
        public void ShouldBeAbleToUseProfigurationSetToNameProfigurations()
        {
            DirectoryInfo    dir        = new DirectoryInfo(MethodBase.GetCurrentMethod().Name);
            ProfigurationSet profSet    = new ProfigurationSet(dir);
            string           randomName = "Test_".RandomLetters(4);
            Profiguration    prof       = profSet.Get(randomName);

            Expect.IsNotNull(prof);
            Expect.IsTrue(File.Exists(Path.Combine(dir.FullName, randomName)));
            Expect.IsTrue(File.Exists(Path.Combine(dir.FullName, randomName + ".key")));
        }
Exemplo n.º 2
0
        public void ShouldBeAbleToSaveAProfigurationProvidingAName()
        {
            DirectoryInfo    dir        = new DirectoryInfo(MethodBase.GetCurrentMethod().Name);
            ProfigurationSet set        = new ProfigurationSet(dir);
            string           randomName = "Test_".RandomLetters(4);
            Profiguration    prof       = new Profiguration();

            prof.AppSettings["test"] = "monkey";

            set.Save(randomName, prof);

            Expect.IsTrue(File.Exists(Path.Combine(dir.FullName, randomName)));
            Expect.IsTrue(File.Exists(Path.Combine(dir.FullName, randomName + ".key")));

            Profiguration verify = set.Get(randomName);

            Expect.AreEqual("monkey", verify.AppSettings["test"]);
        }