void TestDate(Retrospective expected, Retrospective not, DateTime?expectedDate) { RetrospectiveFilter filter = new RetrospectiveFilter(); filter.Project.Add(SandboxProject); filter.Date.Add(expectedDate); ResetInstance(); expected = Instance.Get.RetrospectiveByID(expected.ID); not = Instance.Get.RetrospectiveByID(not.ID); ICollection <Retrospective> results = SandboxProject.GetRetrospectives(filter); Assert.IsTrue(FindRelated(expected, results), "Expected to find Retrospective that matched filter."); Assert.IsFalse(FindRelated(not, results), "Expected to NOT find Retrospective that doesn't match filter."); foreach (Retrospective result in results) { Assert.AreEqual(expectedDate, result.Date); } }
void TestFacilitatedBy(Retrospective expected, Retrospective not, Member expectedFacilitator) { RetrospectiveFilter filter = new RetrospectiveFilter(); filter.Project.Add(SandboxProject); filter.FacilitatedBy.Add(expectedFacilitator); ResetInstance(); expectedFacilitator = (expectedFacilitator != null) ? Instance.Get.MemberByID(expectedFacilitator.ID) : null; expected = Instance.Get.RetrospectiveByID(expected.ID); not = Instance.Get.RetrospectiveByID(not.ID); ICollection <Retrospective> results = SandboxProject.GetRetrospectives(filter); Assert.IsTrue(FindRelated(expected, results), "Expected to find Retrospective that matched filter."); Assert.IsFalse(FindRelated(not, results), "Expected to NOT find Retrospective that doesn't match filter."); foreach (Retrospective result in results) { Assert.AreEqual(expectedFacilitator, result.FacilitatedBy); } }
void TestIteration(Retrospective expected, Retrospective not, Iteration expectedIteration) { RetrospectiveFilter filter = new RetrospectiveFilter(); filter.Project.Add(SandboxProject); filter.Iteration.Add(expectedIteration); ResetInstance(); expectedIteration = (expectedIteration != null) ? Instance.Get.IterationByID(expectedIteration.ID) : null; expected = Instance.Get.RetrospectiveByID(expected.ID); not = Instance.Get.RetrospectiveByID(not.ID); ICollection <Retrospective> results = SandboxProject.GetRetrospectives(filter); Assert.IsTrue(FindRelated(expected, results), "Expected to find Retrospective that matched filter."); Assert.IsFalse(FindRelated(not, results), "Expected to NOT find Retrospective that doesn't match filter."); foreach (Retrospective result in results) { Assert.AreEqual(expectedIteration, result.Iteration); } }