Пример #1
0
        public static IList <TrackBranch> DeserializeClean(string path, DXVcsWrapper vcsWrapper)
        {
            var branches = DeserializeCore(path);

            ProcessTrackItems(branches, vcsWrapper, false);
            return(branches);
        }
Пример #2
0
 public RegisteredUsers(GitLabWrapper gitLabWrapper, DXVcsWrapper vcsWrapper)
 {
     this.gitLabWrapper = gitLabWrapper;
     ADUsers            = ADWrapper.GetUsers().ToDictionary(x => x.UserName, new UserNameEqualityComparer());
     Users         = CreateGitLabUsers().ToDictionary(x => x.UserName, new UserNameEqualityComparer());
     this.VcsUsers = vcsWrapper.GetUsers().ToList();
 }
Пример #3
0
 public SyncHistoryWrapper(SyncHistory history, DXVcsWrapper vcsWrapper, string vcsHistoryPath, string localHistoryPath)
 {
     this.history          = history;
     this.vcsHistoryPath   = vcsHistoryPath;
     this.localHistoryPath = localHistoryPath;
     this.vcsWrapper       = vcsWrapper;
 }
Пример #4
0
 public void RegisterUser()
 {
     GitLabWrapper   gitLabWrapper = new GitLabWrapper(TestCredentials.GitServer, TestCredentials.GitLabToken);
     DXVcsWrapper    vcsWrapper    = new DXVcsWrapper(TestCredentials.VcsServer);
     RegisteredUsers users         = new RegisteredUsers(gitLabWrapper, vcsWrapper);
     var             user          = users.GetUser("Barakhov");
 }
Пример #5
0
 static void ProcessTrackItems(IList <TrackBranch> branches, DXVcsWrapper vcsWrapper)
 {
     foreach (var branch in branches)
     {
         foreach (var trackItem in branch.TrackItems)
         {
             trackItem.Branch = branch;
         }
         branch.TrackItems = CalcTrackItems(branch, branch.TrackItems, vcsWrapper);
     }
 }
Пример #6
0
        public static IList <TrackBranch> Deserialize(string path, DXVcsWrapper vcsWrapper)
        {
            if (!File.Exists(path))
            {
                Log.Error($"Track branch config with path {path} was not found.");
                return(new List <TrackBranch>());
            }
            SharpSerializer serializer = new SharpSerializer();
            var             branches   = (IList <TrackBranch>)serializer.Deserialize(path);

            ProcessTrackItems(branches, vcsWrapper);
            return(branches);
        }
Пример #7
0
        public void SearchRegisteredUser()
        {
            GitLabWrapper   gitLabWrapper = new GitLabWrapper(TestCredentials.GitServer, TestCredentials.GitLabToken);
            DXVcsWrapper    vcsWrapper    = new DXVcsWrapper(TestCredentials.VcsServer);
            RegisteredUsers users         = new RegisteredUsers(gitLabWrapper, vcsWrapper);

            var user = users.GetUser("litvinov");

            Assert.IsNotNull(user);
            Assert.IsTrue(user.IsRegistered);

            var user2 = users.GetUser("Litvinov");

            Assert.IsNotNull(user2);
            Assert.IsTrue(user2.IsRegistered);
        }
Пример #8
0
        static IList <TrackItem> CalcTrackItems(TrackBranch branch, IEnumerable <TrackItem> trackItems, DXVcsWrapper vcsWrapper)
        {
            List <TrackItem> list = new List <TrackItem>();

            foreach (var trackItem in trackItems)
            {
                list.AddRange(vcsWrapper.GenerateTrackItems(branch, trackItem));
            }
            return(list);
        }