当前位置: 首页>>代码示例>>C#>>正文


C# WorkItem.SyncToLatest方法代码示例

本文整理汇总了C#中WorkItem.SyncToLatest方法的典型用法代码示例。如果您正苦于以下问题:C# WorkItem.SyncToLatest方法的具体用法?C# WorkItem.SyncToLatest怎么用?C# WorkItem.SyncToLatest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WorkItem的用法示例。


在下文中一共展示了WorkItem.SyncToLatest方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: NewTask_succeeds

        public void NewTask_succeeds()
        {
            // prepare
            this.fixture.PushPolicies("NewObjects");

            string workItemTypeName = "Bug";
            var targetType = this.fixture.Project.WorkItemTypes[workItemTypeName];
            var wiBug = new WorkItem(targetType);
            wiBug.Title = workItemTypeName + " NewLink_succeeds";

            // trigger
            wiBug.Save();
            Thread.Sleep(4000);
            wiBug.SyncToLatest();

            // validate
            var hierarchyRelationship = this.fixture.WorkItemStore.WorkItemLinkTypes["System.LinkTypes.Hierarchy"];
            Assert.Equal(1, wiBug.WorkItemLinks.Count);
            var actualLink = wiBug.WorkItemLinks[0];
            Assert.Equal(hierarchyRelationship.ForwardEnd.ImmutableName, actualLink.LinkTypeEnd.ImmutableName);
            Assert.Equal(wiBug.Id, actualLink.SourceId);
            var wiTask = fixture.WorkItemStore.GetWorkItem(actualLink.TargetId);
            Assert.NotNull(wiTask);
            Assert.Equal("Task", wiTask.Type.Name);
            Assert.Equal("Task auto-generated for " + wiBug.Title, wiTask.Title);
        }
开发者ID:veredflis,项目名称:tfsaggregator,代码行数:26,代码来源:NewObjectsTests.cs

示例2: NewLink_succeeds

        public void NewLink_succeeds()
        {
            // prepare
            this.fixture.PushPolicies("NewObjects");

            string workItemTypeName = "Product Backlog Item";
            var targetType = this.fixture.Project.WorkItemTypes[workItemTypeName];
            var wiPBI = new WorkItem(targetType);
            wiPBI.Title = workItemTypeName + " NewLink_succeeds";
            wiPBI.Save();

            workItemTypeName = "Task";
            targetType = this.fixture.Project.WorkItemTypes[workItemTypeName];
            var wiTask = new WorkItem(targetType);
            wiTask.Title = workItemTypeName + " NewLink_succeeds";

            // trigger
            wiTask.Save();
            Thread.Sleep(3000);
            wiPBI.SyncToLatest();
            wiTask.SyncToLatest();

            // validate
            var hierarchyRelationship = this.fixture.WorkItemStore.WorkItemLinkTypes["System.LinkTypes.Hierarchy"];
            Assert.Equal(1, wiTask.WorkItemLinks.Count);
            var actualLink = wiTask.WorkItemLinks[0];
            Assert.Equal(hierarchyRelationship.ReverseEnd.ImmutableName, actualLink.LinkTypeEnd.ImmutableName);
            Assert.Equal(wiTask.Id, actualLink.SourceId);
            Assert.Equal(1, actualLink.TargetId);
        }
开发者ID:veredflis,项目名称:tfsaggregator,代码行数:30,代码来源:NewObjectsTests.cs


注:本文中的WorkItem.SyncToLatest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。