示例#1
0
        public void Startup()
        {
            _directoryWrapper = new DirectoryWrapper();
            if (_directoryWrapper.Exists(ResourcesBackup))
            {
                _directoryWrapper.Delete(ResourcesBackup, true);
            }
            if (_directoryWrapper.Exists(EnvironmentVariables.ResourcePath))
            {
                _directoryWrapper.Move(EnvironmentVariables.ResourcePath, ResourcesBackup);
            }
            var    serverUnderTest = Process.GetProcessesByName("Warewolf Server")[0];
            string exePath;

            try
            {
                exePath = Path.GetDirectoryName(serverUnderTest.MainModule?.FileName);
            }
            catch (Win32Exception)
            {
                exePath = Environment.CurrentDirectory;
            }
            var destDirName = Path.Combine(exePath, "Resources");

            if (!_directoryWrapper.Exists(destDirName))
            {
                _directoryWrapper.Move(Path.Combine(exePath, "Resources - Release", "Resources"), destDirName);
            }
        }
示例#2
0
 public void Cleanup()
 {
     if (_directoryWrapper.Exists(EnvironmentVariables.ResourcePath))
     {
         _directoryWrapper.Delete(EnvironmentVariables.ResourcePath, true);
     }
     if (_directoryWrapper.Exists(ResourcesBackup))
     {
         _directoryWrapper.Move(ResourcesBackup, EnvironmentVariables.ResourcePath);
     }
     ExecuteRequest(new Uri("http://localhost:3142/services/FetchExplorerItemsService.json?ReloadResourceCatalogue=true"));
 }
示例#3
0
        public void DeleteAllTests(Guid resourceId)
        {
            var dirPath = GetTestPathForResourceId(resourceId);

            if (_directoryWrapper.Exists(dirPath))
            {
                _directoryWrapper.Delete(dirPath, true);
                Tests.TryRemove(resourceId, out List <IServiceTestModelTO> removedTests);
            }
        }
        public void DeleteAllCoverageReports(Guid resourceId)
        {
            var dirPath = GetTestCoveragePathForResourceId(resourceId);

            if (_directoryWrapper.Exists(dirPath))
            {
                _directoryWrapper.Delete(dirPath, true);
                TestCoverageReports.TryRemove(resourceId, out _);
            }
        }