Пример #1
0
 /// <summary>
 /// If paths are invalid an exception is thrown otherwise returns.
 /// </summary>
 /// <param name="paths"></param>
 public static void ValidatePaths(RTDSPaths paths)
 {
     if (paths == null)
     {
         Logger.Fatal("The RTDSPaths object is null.");
         throw new MissingSpecifiedPathException("The RTDSPaths object is null.");
     }
     if (string.IsNullOrEmpty(paths.BaseSourcePath))
     {
         Logger.Fatal("Base source path is missing.");
         throw new MissingSpecifiedPathException("Base source path is missing.");
     }
     if (string.IsNullOrEmpty(paths.BaseTargetPath))
     {
         Logger.Fatal("Base target path is missing.");
         throw new MissingSpecifiedPathException("Base target path is missing.");
     }
     if (!Directory.Exists(paths.BaseSourcePath))
     {
         Logger.Fatal("The base source path does not exists");
         throw new InvalidPathException(paths.BaseSourcePath);
     }
     if (!Directory.Exists(paths.BaseTargetPath))
     {
         Logger.Fatal("The base target path does not exists");
         throw new InvalidPathException(paths.BaseTargetPath);
     }
 }
Пример #2
0
        public void SetUp()
        {
            _uut = new RTDSImpl();
            var configuration = CreateDefaultConfiguration();

            _paths = configuration.Paths;
            Configuration.ConfigurationManager.OverrideConfiguration(configuration, false);
        }
        public void SetUp()
        {
            _fakeFolderMonitor       = Substitute.For <IMonitor>();
            _fakeMonitorFactory      = Substitute.For <IMonitorFactory>();
            _fakeSubfolderController = Substitute.For <ISubfolderController>();
            _fakeMonitorFactory.CreateFolderMonitor().Returns(_fakeFolderMonitor);

            var configuration = CreateDefaultConfiguration();

            _paths = configuration.Paths;
            Configuration.ConfigurationManager.OverrideConfiguration(configuration, false);

            _uut = new BaseFolderController(_fakeMonitorFactory, _fakeSubfolderController);
        }