コード例 #1
0
        void TestPriority(Goal expected, Goal not, string expectedPriority)
        {
            GoalFilter filter = new GoalFilter();

            filter.Project.Add(SandboxProject);
            filter.Priority.Add(expectedPriority);

            ResetInstance();
            expected = Instance.Get.GoalByID(expected.ID);
            not      = Instance.Get.GoalByID(not.ID);

            ICollection <Goal> results = SandboxProject.GetGoals(filter);

            Assert.IsTrue(FindRelated(expected, results), "Expected to find goal that matched filter.");
            Assert.IsFalse(FindRelated(not, results), "Expected to NOT find goal that doesn't match filter.");
            foreach (Goal result in results)
            {
                Assert.AreEqual(expectedPriority, result.Priority.CurrentValue);
            }
        }
コード例 #2
0
 /// <summary>
 /// Get Goals 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 <Goal> Goals(GoalFilter filter)
 {
     return(Get <Goal>(filter ?? new GoalFilter()));
 }
コード例 #3
0
 /// <summary>
 /// Get Goals 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 Goals 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 Goals</returns>
 public ICollection <Goal> GetGoals(GoalFilter filter, bool includeSubprojects)
 {
     return(Instance.Get.Goals(WithThisProjectIncludedIn(filter, includeSubprojects)));
 }
コード例 #4
0
 /// <summary>
 /// Get Goals in this Project filtered as specified in the passed in filter. Does not include subprojects.
 /// </summary>
 /// <param name="filter">Criteria to filter on. Project will be set automatically. If null, all Goals in the project are returned.</param>
 /// <returns>An ICollection of Goals</returns>
 public ICollection <Goal> GetGoals(GoalFilter filter)
 {
     return(GetGoals(filter, false));
 }