public void AddingFileTwice()
 {
     Project addFileTwice = new Project("Adding File Twice");
     addFileTwice.AddFile(@"C:\test\driven\design\application.cfg.xml");
     Assert.AreEqual(1, addFileTwice.Files.Count, "Didn't add a file to Files collections");
     addFileTwice.AddFile(@"C:\test\driven\design\application.cfg.xml");
     Assert.AreEqual(1, addFileTwice.Files.Count, "Add a file multiply times");
 }
        public void AddConfigChangeAppSetup()
        {
            Project changeAppSetup = new Project("Add Config Change App Setup");
            changeAppSetup.AddFile(TestDataUtil.TestConfigFile);
            changeAppSetup.AddFile(TestDataUtil.TestDllFile);
            changeAppSetup.AddFile(TestDataUtil.TestMappingFile);

            changeAppSetup.HandleFiles();
            Assert.AreEqual(TestDataUtil.TestConfigFile, changeAppSetup.AppDomainSetup.ConfigurationFile, "Configuration file was not set");
        }
 public void TestFixtureSetup()
 {
     current = new Project(prjName, new Project.Context());
     current.AddFile(TestDataUtil.TestConfigFile);
     current.AddFile(TestDataUtil.TestDllFile);
     current.AddFile(TestDataUtil.TestMappingFile);
     current.BuildProject();
 }
        public void ResetProjectAfterBuilding()
        {
            Project resetable = new Project("Resetabble Project");
            resetable.AddFile(TestDataUtil.TestConfigFile);
            resetable.AddFile(TestDataUtil.TestDllFile);
            resetable.AddFile(TestDataUtil.TestMappingFile);
            resetable.BuildProject();
            Assert.IsTrue(resetable.IsProjectBuilt, "Project was not built");
            SerializableTestClassForDomainUnload testUnload = new SerializableTestClassForDomainUnload();
            resetable.AppDomain.DomainUnload += new EventHandler(testUnload.AppDomain_DomainUnload);
            resetable.ResetProject();
            Assert.IsFalse(resetable.IsProjectBuilt, "Project was not reset properly");
            Assert.IsTrue(testUnload.ProjectAppDomainWasUnloaded, "Project's AppDomain was not unloaded");
            Assert.IsNull(resetable.AppDomain, "AppDomain was no released.");

            resetable.Dispose();
        }
 public void SetUp()
 {
     repository = TestDataUtil.CreateFileRepository();
     current = new Project(projectName);
     current.AddFile(TestDataUtil.TestConfigFile);
     current.AddFile(TestDataUtil.TestDllFile);
     current.AddFile(TestDataUtil.TestMappingFile);
     repository.SaveProject(current);
 }