Пример #1
0
        public void QualifiedPathsWithSameCaseInsensitiveRoot_AndDifferingCase_AreEqual()
        {
            var root = new LocalRoot(new Uri(@"C:\"), FileSystemCasing.CasePreservingInsensitive);
            var a    = new QualifiedPath(root, RelativePath.CreateFromSegments("a", "b", "c"));
            var b    = new QualifiedPath(root, RelativePath.CreateFromSegments("A", "B", "C"));

            Assert.That(a, Is.EqualTo(b).Using(default(QualifiedPath.DefaultEqualityComparer)));
        }
        /// <summary>
        /// Initializes the environement.
        /// </summary>
        protected virtual void InitEnvironment()
        {
            SetUATLocation();

            LocalRoot = CommandUtils.GetEnvVar(EnvVarNames.LocalRoot);
            if (String.IsNullOrEmpty(CommandUtils.GetEnvVar(EnvVarNames.EngineSavedFolder)))
            {
                SetUATSavedPath();
            }

            if (LocalRoot.EndsWith(":"))
            {
                LocalRoot += Path.DirectorySeparatorChar;
            }

            EngineSavedFolder = CommandUtils.GetEnvVar(EnvVarNames.EngineSavedFolder);
            CSVFile           = CommandUtils.GetEnvVar(EnvVarNames.CSVFile);
            LogFolder         = CommandUtils.GetEnvVar(EnvVarNames.LogFolder);
            RobocopyExe       = GetSystemExePath("robocopy.exe");
            MountExe          = GetSystemExePath("mount.exe");
            CmdExe            = Utils.IsRunningOnMono ? "/bin/sh" : GetSystemExePath("cmd.exe");
            MallocNanoZone    = "0";
            CommandUtils.SetEnvVar(EnvVarNames.MacMallocNanoZone, MallocNanoZone);
            if (String.IsNullOrEmpty(LogFolder))
            {
                throw new AutomationException("Environment is not set up correctly: LogFolder is not set!");
            }

            if (String.IsNullOrEmpty(LocalRoot))
            {
                throw new AutomationException("Environment is not set up correctly: LocalRoot is not set!");
            }

            if (String.IsNullOrEmpty(EngineSavedFolder))
            {
                throw new AutomationException("Environment is not set up correctly: EngineSavedFolder is not set!");
            }

            // Make sure that the log folder exists
            var LogFolderInfo = new DirectoryInfo(LogFolder);

            if (!LogFolderInfo.Exists)
            {
                LogFolderInfo.Create();
            }

            // Setup the timestamp string
            DateTime LocalTime = DateTime.Now;

            string TimeStamp = LocalTime.Year + "-"
                               + LocalTime.Month.ToString("00") + "-"
                               + LocalTime.Day.ToString("00") + "_"
                               + LocalTime.Hour.ToString("00") + "."
                               + LocalTime.Minute.ToString("00") + "."
                               + LocalTime.Second.ToString("00");

            TimestampAsString = TimeStamp;

            SetupBuildEnvironment();

            LogSettings();
        }
Пример #3
0
 public DuplicateLocalRootDeclaration(LocalRoot node)
 {
     Node = node ?? throw new ArgumentNullException(nameof(node));
 }
Пример #4
0
 public OverlappingLocalRootDeclaration(LocalRoot parent, LocalRoot child)
 {
     Parent = parent;
     Child  = child;
 }