public void Init()
        {
            _discoverer = new PowerShellTestDiscoverer();

            _discoveryContext = new Mock <IDiscoveryContext>();
            _sink             = new Mock <ITestCaseDiscoverySink>();
            _messageLogger    = new Mock <IMessageLogger>();
        }
Пример #2
0
 public PowerShellTestExecutorTests()
 {
     discoverer = new PowerShellTestDiscoverer(logger.Object);
     executor   = new PowerShellTestExecutor(logger.Object, () => new StopwatchTimer(), new SynchronousTaskScheduler())
     {
         OutputDirectory = new DirectoryInfo(Directory.GetCurrentDirectory())
     };
 }
Пример #3
0
        protected void LoadFromFolder(string path)
        {
            RootPath = path;
            TestProject testProject = PowerShellTestDiscoverer.GetFolderTests(path, null);

            if (testProject.ItemCount() > 0)
            {
                TestSolution solution = new TestSolution();
                solution.Projects.Add(testProject);
                Model.Merge(solution);
                CleartestFilesByPath();
                OnModelChanged();
            }
        }
Пример #4
0
        public void RunTests(string filePath, int lineNumber)
        {
            TestFile testFile = GetTestFileByPath(filePath);
            TestFile newFile  = PowerShellTestDiscoverer.DiscoverTestFile(filePath);

            if (testFile == null)
            {
                testFile = newFile;
                AddTestFile(testFile);
            }
            else
            {
                testFile.Merge(newFile);
            }
            TestModel model = testFile.FindModelByLineNumber(lineNumber);

            if (model != null)
            {
                DoRunCommandAsync(model);
            }
        }
Пример #5
0
 public PowerShellTestDiscovererTests()
 {
     discoverer = new PowerShellTestDiscoverer(logger.Object);
 }