public void PlaybackSession(string filename)
        {
            CloseActiveProject();

            string absFilename = filename;

            if (!FileHelper.IsAbsolute(absFilename))
            {
                absFilename = Path.Combine(TestDataDir, filename);
            }

            string        projDir = EditorProject.FindProjectFor(absFilename);
            EditorProject proj    = new EditorProject();

            if (projDir == null || !proj.Load(projDir))
            {
                throw new FileNotFoundException("Project file not found for " + absFilename);
            }

            EditorManager.Project = proj;

            RecordSession session = RecordSession.LoadFromFile(proj.MakeRelative(absFilename));

            if (session == null)
            {
                throw new FileNotFoundException("Session file not found", absFilename);
            }

            TestRecordReport report = new TestRecordReport();

            if (!session.Playback(report, true))
            {
                throw new Exception("Record session '" + session.Filename + "' failed.\nItem '" + report.CurrentItem + "' triggered the following error:\n\n" + report.LastError + "\n\n" + report.LastErrorDetailed);
            }
        }
Exemplo n.º 2
0
        public void PlaybackSessionsInProject(string projectDir, string subdir)
        {
            CloseActiveProject();

            string absFilename = projectDir;

            if (!FileHelper.IsAbsolute(absFilename))
            {
                absFilename = Path.Combine(TestDataDir, projectDir);
            }

            string        projDir = EditorProject.FindProjectFor(Path.Combine(absFilename, "dummy.xyz"));
            EditorProject proj    = new EditorProject();

            if (projDir == null)
            {
                throw new FileNotFoundException("Project file not found for " + absFilename);
            }

            proj.Load(projDir);

            EditorManager.Project = proj;

            DirectoryInfo folder = new DirectoryInfo(proj.MakeAbsolute(subdir));

            FileInfo[] files = folder.GetFiles("*.record");
            foreach (FileInfo file in files)
            {
                RecordSession session = RecordSession.LoadFromFile(Path.Combine(subdir, file.Name));
                if (session == null)
                {
                    throw new FileNotFoundException("Session file not found", absFilename);
                }

                TestRecordReport report = new TestRecordReport();
                if (!session.Playback(report, true))
                {
                    throw new Exception("Record session '" + session.Filename + "' failed.\nItem '" + report.CurrentItem + "' triggered the following error:\n\n" + report.LastError + "\n\n" + report.LastErrorDetailed);
                }
            }
        }
Exemplo n.º 3
0
        public void PlaybackSessionsInProject(string projectDir, string subdir)
        {
            CloseActiveProject();

              string absFilename = projectDir;
              if (!FileHelper.IsAbsolute(absFilename))
            absFilename = Path.Combine(TestDataDir, projectDir);

              string projDir = EditorProject.FindProjectFor(Path.Combine(absFilename, "dummy.xyz"));
              EditorProject proj = new EditorProject();
              if (projDir == null || !proj.Load(projDir))
            throw new FileNotFoundException("Project file not found for " + absFilename);

              EditorManager.Project = proj;

              DirectoryInfo folder = new DirectoryInfo(proj.MakeAbsolute(subdir));
              FileInfo[] files = folder.GetFiles("*.record");
              foreach (FileInfo file in files)
              {
            RecordSession session = RecordSession.LoadFromFile(Path.Combine(subdir, file.Name));
            if (session == null)
              throw new FileNotFoundException("Session file not found", absFilename);

            TestRecordReport report = new TestRecordReport();
            if (!session.Playback(report, true))
              throw new Exception("Record session '" + session.Filename + "' failed.\nItem '" + report.CurrentItem + "' triggered the following error:\n\n" + report.LastError + "\n\n" + report.LastErrorDetailed);
              }
        }
Exemplo n.º 4
0
        public void PlaybackSession(string filename)
        {
            CloseActiveProject();

              string absFilename = filename;
              if (!FileHelper.IsAbsolute(absFilename))
            absFilename = Path.Combine(TestDataDir, filename);

              string projDir = EditorProject.FindProjectFor(absFilename);
              EditorProject proj = new EditorProject();
              if (projDir == null || !proj.Load(projDir))
            throw new FileNotFoundException("Project file not found for " + absFilename);

              EditorManager.Project = proj;

              RecordSession session = RecordSession.LoadFromFile(proj.MakeRelative(absFilename));
              if (session == null)
            throw new FileNotFoundException("Session file not found", absFilename);

              TestRecordReport report = new TestRecordReport();
              if (!session.Playback(report, true))
            throw new Exception("Record session '" + session.Filename + "' failed.\nItem '" + report.CurrentItem + "' triggered the following error:\n\n" + report.LastError + "\n\n" + report.LastErrorDetailed);
        }