Ejemplo n.º 1
0
 public void ThrowIfCannotCreateDestination()
 {
     Assert.Throws <ApplicationException>(() =>
                                          BackupMaker.BackupToExternal(BasilProject.GetPretendProjectDirectory(),
                                                                       "QQ:\\" + Path.GetRandomFileName(),
                                                                       _filesToBackup));
 }
Ejemplo n.º 2
0
 public void Setup()
 {
     WeSayProjectTestHelper.InitializeForTests();
     _destinationZip    = Path.Combine(Path.GetTempPath(), Path.GetTempFileName() + ".zip");
     _sourceProjectPath = BasilProject.GetPretendProjectDirectory();
     _backupMaker       = new BackupMaker();
     _filesToBackup     = WeSayWordsProject.GetFilesBelongingToProject(_sourceProjectPath);
 }
Ejemplo n.º 3
0
        public void TestFixtureSetUp()
        {
            _project = new WeSayWordsProject();
            _project.UiOptions.Language = "en";
            _project.LoadFromProjectDirectoryPath(BasilProject.GetPretendProjectDirectory());

            _project.Tasks = new List <ITask>();
        }
Ejemplo n.º 4
0
        public void ProjectFilesTouched()
        {
            _window.OpenProject(BasilProject.GetPretendProjectDirectory());
            string   p      = WeSayWordsProject.Project.PathToConfigFile;
            DateTime before = File.GetLastWriteTime(p);

            _mainWindowTester.Close();
            DateTime after = File.GetLastWriteTime(p);

            Assert.AreNotEqual(before, after);
        }
Ejemplo n.º 5
0
 public void WalkTabsAfterOpeningPretendProject()
 {
     _window.OpenProject(BasilProject.GetPretendProjectDirectory());
     //create or overwrite the tasks with our stored resource
     //            File.Delete(WeSayWordsProject.Project.PathToProjectTaskInventory);
     //            StreamWriter writer = File.CreateText(WeSayWordsProject.Project.PathToProjectTaskInventory);
     //            writer.Write(TestResources.tasks);
     //            writer.Close();
     File.Copy(
         Path.Combine(WeSayWordsProject.Project.ApplicationTestDirectory,
                      "PRETEND.WeSayConfig"),
         WeSayWordsProject.Project.PathToConfigFile,
         true);
     WalkTopLevelTabs();
 }
        public void WalkTabsAfterOpeningPretendProject()
        {
            _window.OpenProject(BasilProject.GetPretendProjectDirectory());
            File.Copy(
                Path.Combine(WeSayWordsProject.Project.ApplicationTestDirectory,
                             "PRETEND.WeSayConfig"),
                WeSayWordsProject.Project.PathToConfigFile,
                true);

            ToolStrip toolstrip = (ToolStrip)_window.Controls.Find("_areasToolStrip", true)[0];

            foreach (ToolStripButton button in toolstrip.Items)
            {
                button.PerformClick();
            }
        }
Ejemplo n.º 7
0
 public void ReadListFile_NonExistantSemanticDomainFile_Throws()
 {
     using (var projectDirectory = new TemporaryFolder())
     {
         if (File.Exists(Path.Combine(BasilProject.GetPretendProjectDirectory(), "SemDom.xml")))
         {
             File.Delete(Path.Combine(BasilProject.GetPretendProjectDirectory(), "SemDom.xml"));
         }
         //setting up a minimal WeSay project with a config file that contains an id for a nonexistent writing system
         var project       = new WeSayWordsProject();
         var localizedList = new LocalizedListParser();
         localizedList.ApplicationCommonDirectory = BasilProject.GetPretendProjectDirectory();
         localizedList.PathToWeSaySpecificFilesDirectoryInProject = projectDirectory.Path;
         localizedList.SemanticDomainWs = "en";
         Assert.Throws <ApplicationException>(() => localizedList.ReadListFile());
     }
 }