/// <summary> /// Tasks and Tests owned by this member. /// </summary> public ICollection <SecondaryWorkitem> GetOwnedSecondaryWorkitems(SecondaryWorkitemFilter filter) { filter = filter ?? new SecondaryWorkitemFilter(); filter.Owners.Clear(); filter.Owners.Add(this); return(Instance.Get.SecondaryWorkitems(filter)); }
public void OnlyTasksAndTests() { var root = SandboxProject.ParentProject; var wiFilter = new SecondaryWorkitemFilter(); wiFilter.State.Add(State.Active); var totalEstimate = Instance.Get.Workitems(wiFilter).Where(workitem => workitem.DetailEstimate != null) .Aggregate <Workitem, double?>(null, (current, workitem) => current + workitem.DetailEstimate); Assert.AreEqual(totalEstimate, root.GetTotalDetailEstimate(wiFilter)); }
[Test] public void Parent() { Story story = GetStory("Type Filter"); ResetInstance(); SecondaryWorkitemFilter filter = new SecondaryWorkitemFilter(); filter.Parent.Add(story); filter.Name.Add("One"); Assert.AreEqual(2, Instance.Get.SecondaryWorkitems(filter).Count); }
public void OwnedSeconardyWorkitems() { var story = SandboxProject.CreateStory("Story"); var task = story.CreateTask("Task"); story.CreateTest("Test"); var member = Instance.Get.MemberByID("Member:20"); task.Owners.Add(member); var filter = new SecondaryWorkitemFilter(); filter.Project.Add(SandboxProject); var items = member.GetOwnedSecondaryWorkitems(filter); CollectionAssert.AreEqual(new string[] { "Task" }, DeriveListOfNamesFromAssets(items)); }
public void FilterToAssetType() { int originalCount = SandboxProject.GetSecondaryWorkitems(null).Count; Story story = SandboxProject.CreateStory("Should not show up"); Task task = story.CreateTask("Task"); Test test = story.CreateTest("Test"); SecondaryWorkitemFilter filter = new SecondaryWorkitemFilter(); filter.Project.Add(SandboxProject); ICollection <SecondaryWorkitem> workitems = SandboxProject.GetSecondaryWorkitems(filter); try { Assert.AreEqual(originalCount + 2, workitems.Count); } finally { test.Delete(); task.Delete(); } }
/// <summary> /// Get secondary workitems (tasks and tests) filtered by the criteria specified in the passed in filter. /// </summary> /// <param name="filter">Limit the items returned. If null, then all items returned.</param> /// <returns>ICollection of items as specified in the filter.</returns> public ICollection <SecondaryWorkitem> SecondaryWorkitems(SecondaryWorkitemFilter filter) { return(Get <SecondaryWorkitem>(filter ?? new SecondaryWorkitemFilter())); }
/// <summary> /// Get SecondaryWorkitems in this Project filtered as specified in the passed in filter. /// </summary> /// <param name="filter">Criteria to filter on. Project will be set automatically. If null, all tasks and tests in the project are returned.</param> /// <param name="includeSubprojects">Specifies whether to include items from sub project or not. This only adds open subprojects.</param> /// <returns>An ICollection of SecondaryWorkitem</returns> public ICollection <SecondaryWorkitem> GetSecondaryWorkitems(SecondaryWorkitemFilter filter, bool includeSubprojects) { return(Instance.Get.SecondaryWorkitems(WithThisProjectIncludedIn(filter, includeSubprojects))); }
/// <summary> /// Get SecondaryWorkitems in this Project filtered as specified in the passed in filter. /// </summary> /// <param name="filter">Criteria to filter on. Project will be set automatically. If null, all tasks and tests in the project are returned.</param> /// <returns>An ICollection of SecondaryWorkitem</returns> public ICollection <SecondaryWorkitem> GetSecondaryWorkitems(SecondaryWorkitemFilter filter) { return(GetSecondaryWorkitems(filter, false)); }