Esempio n. 1
0
 public TestLog FileRemoved(
     string path,
     TouchedFile.ContentType type = TouchedFile.ContentType.UNKNOWN)
 {
     TouchPath(path, TouchedFileAction.REMOVED, null, null, type);
     return(this);
 }
Esempio n. 2
0
 public TestLog FileModified(
     string path,
     TouchedFile.ContentType type = TouchedFile.ContentType.UNKNOWN)
 {
     TouchPath(path, TouchedFileAction.MODIFIED, null, null, type);
     return(this);
 }
Esempio n. 3
0
        protected void AddOrModifyTouchedFile(
            TouchedFileAction action,
            string path,
            string sourcePath,
            TouchedFile.ContentType type)
        {
            path       = GitPathToPath(path);
            sourcePath = GitPathToPath(sourcePath);

            var touchedFile = touchedFiles.Where(x => x.Path == path).SingleOrDefault();

            if (touchedFile == null)
            {
                touchedFiles.Add(new TouchedFile()
                {
                    Path       = path,
                    Action     = action,
                    SourcePath = sourcePath,
                    Type       = type,
                });
            }
            else
            {
                if (touchedFile.Action == TouchedFileAction.MODIFIED &&
                    action != TouchedFileAction.MODIFIED)
                {
                    touchedFile.Action = action;
                }
            }
        }
Esempio n. 4
0
        protected void MapTouchedFile(
            TouchedFileGitAction action,
            string path,
            string sourcePath,
            TouchedFile.ContentType type,
            Action <TouchedFileAction, string, string, TouchedFile.ContentType> touchedFileMapper)
        {
            switch (action)
            {
            case TouchedFileGitAction.MODIFIED:
                touchedFileMapper(TouchedFileAction.MODIFIED, path, sourcePath, type);
                break;

            case TouchedFileGitAction.ADDED:
                touchedFileMapper(TouchedFileAction.ADDED, path, sourcePath, type);
                break;

            case TouchedFileGitAction.DELETED:
                touchedFileMapper(TouchedFileAction.REMOVED, path, sourcePath, type);
                break;

            case TouchedFileGitAction.RENAMED:
                touchedFileMapper(TouchedFileAction.REMOVED, sourcePath, null, type);
                touchedFileMapper(TouchedFileAction.ADDED, path, sourcePath, type);
                break;

            case TouchedFileGitAction.COPIED:
                touchedFileMapper(TouchedFileAction.ADDED, path, sourcePath, type);
                break;

            default:
                break;
            }
        }
Esempio n. 5
0
 public TestLog FileRenamed(
     string path,
     string sourcePath,
     TouchedFile.ContentType type = TouchedFile.ContentType.UNKNOWN)
 {
     FileRemoved(sourcePath, type);
     FileCopied(path, sourcePath, null, type);
     return(this);
 }
Esempio n. 6
0
 public TestLog FileCopied(
     string path,
     string sourcePath,
     string sourceRevision,
     TouchedFile.ContentType type = TouchedFile.ContentType.UNKNOWN)
 {
     TouchPath(path, TouchedFileAction.ADDED, sourcePath, sourceRevision, type);
     return(this);
 }
Esempio n. 7
0
 private void TouchPath(
     string path,
     TouchedFileAction action,
     string sourcePath,
     string sourceRevision,
     TouchedFile.ContentType type)
 {
     touchedFiles.Add(new TouchedFile()
     {
         Path           = path,
         Action         = action,
         SourcePath     = sourcePath,
         SourceRevision = sourceRevision,
         Type           = type,
     });
 }
Esempio n. 8
0
        protected void ModifyTouchedFile(
            TouchedFileAction action,
            string path,
            string sourcePath,
            TouchedFile.ContentType type)
        {
            path       = GitPathToPath(path);
            sourcePath = GitPathToPath(sourcePath);

            var touchedFile = touchedFiles.SingleOrDefault(x => x.Path == path);

            if (touchedFile != null)
            {
                touchedFile.Action     = action;
                touchedFile.SourcePath = sourcePath;
                touchedFile.Type       = type;
            }
        }