Exemplo n.º 1
0
        /// <summary>
        /// TFSs the vso API.
        /// </summary>
        /// <param name="tfs">The TFS.</param>
        private static void TfsVSOApi(ITfsTeamProjectCollection tfs)
        {
            tfs.EnsureAuthenticated();
            bool first         = true;
            var  workitemstore = tfs.GetService <IWorkItemStore>();


            //var linkTester = workitemstore.GetWorkItem(195);
            //var links = linkTester.Links;
            //var count = links.Count;
            //foreach (ILink link in links)
            //{
            //    Console.WriteLine("\t\t{0}\tComment: {1}", WriteSpecific(link), SafeWriteComment(link));
            //}

            const string        wiql = "SELECT * FROM WorkItems WHERE [System.TeamProject] = 'RestPlaypen' ORDER BY [System.Id] ";
            IWorkItemCollection wic  = workitemstore.Query(wiql);

            foreach (IWorkItem wi in wic)
            {
                if (wi.Rev > 1)
                {
                    Console.WriteLine("{0}:{1}\t{2}", wi.Id, wi.Rev, wi.Title);
                    IRevisionCollection revisions = wi.Revisions;
                    foreach (IRevision revision in revisions)
                    {
                        var value = (DateTime)revision.Fields["System.ChangedDate"].Value;
                        Console.WriteLine("\t{0}\t{1}\t{2} {3}", revision.Index, revision.Fields.Count, value, value.Kind);
                        bool dumpFields = false;
                        if (dumpFields && first)
                        {
                            first = false;
                            List <string> names = (from IField field in revision.Fields select field.ReferenceName).ToList();
                            names.Sort();
                            foreach (string name in names)
                            {
                                Console.WriteLine("\t\t{0}", name);
                            }
                        }
                    }
                }
                if (wi.Links.Count > 0)
                {
                    Console.WriteLine("{0}:{1}\t{2}", wi.Id, wi.Rev, wi.Title);
                    Console.WriteLine("\t{0} Links", wi.Links.Count);
                    foreach (ILink link in wi.Links)
                    {
                        Console.WriteLine("\t\t{0}\tComment: {1}", WriteSpecific(link), SafeWriteComment(link));
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void Initialize_UnitTest()
        {
            ITfsTeamProjectCollection projectCollection = default(ITfsTeamProjectCollection);

            ExecuteMethod(
                () => { return((IITfsTeamProjectCollectionObject)GetInstance()); },
                instance =>
            {
                projectCollection = TfsTeamProjectCollectionImpl_UnitTests.GetInstance();
                Initialize_PreCondition(instance, ref projectCollection);
            },
                instance => { instance.Initialize(projectCollection); },
                instance => { Initialize_PostValidate(instance, projectCollection); });
        }
Exemplo n.º 3
0
        public MockWorkItemStore(ITfsTeamProjectCollection teamProjectCollection, IProject project)
        {
            TeamProjectCollection = teamProjectCollection;
            Projects = new[] { project };

            _workItems = new List <IWorkItem>();

            foreach (var wit in project.WorkItemTypes)
            {
                var wi = new MockWorkItem {
                    Id = _workItems.Count + 1, Type = wit
                };
                _workItems.Add(wi);
            }

            _lookup  = _workItems.ToDictionary(k => k.Id, e => e);
            TimeZone = TimeZone.CurrentTimeZone;
        }
Exemplo n.º 4
0
 /// <summary>
 ///     Initializes the specified project collection.
 /// </summary>
 /// <param name="projectCollection">The project collection.</param>
 /// <exception cref="DynCon.OSI.Core.Helpers.ToBeImplementedException"></exception>
 void IITfsTeamProjectCollectionObject.Initialize(ITfsTeamProjectCollection projectCollection)
 {
     throw new ToBeImplementedException();
 }
Exemplo n.º 5
0
 public MockWorkItemStore(ITfsTeamProjectCollection teamProjectCollection, IEnumerable <IWorkItem> workItems)
     : this(teamProjectCollection, new MockProject())
 {
     _workItems = new List <IWorkItem>(workItems);
     _lookup    = _workItems.ToDictionary(k => k.Id, e => e);
 }
 partial void TeamFoundationServer_SetCondition(ref ITfsTeamProjectCollection instance, ref ITeamFoundationServer setValue);
 partial void ConfigurationServer_SetCondition(ref ITfsTeamProjectCollection instance, ref ITfsConfigurationServer setValue);
 partial void TeamProjectCollection_SetCondition(ref IWorkItemStore instance, ref ITfsTeamProjectCollection setValue);
Exemplo n.º 9
0
 partial void Initialize_PreCondition(IITfsTeamProjectCollectionObject instance, ref ITfsTeamProjectCollection projectCollection);
Exemplo n.º 10
0
 partial void Initialize_PostValidate(IITfsTeamProjectCollectionObject instance, ITfsTeamProjectCollection projectCollection);
Exemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TfsTeamProjectCollectionWrapper"/> class.
 /// </summary>
 /// <param name="instance">The instance.</param>
 public TfsTeamProjectCollectionWrapper(ITfsTeamProjectCollection instance)
 {
     m_Instance = instance;
 }