public void AreElementsSameIgnoringOrder_fails_with_custom_message()
        {
            var o1 = new object();
            var o2 = new object();

            AssertionFailure[] failures = Capture(() => Assert.AreElementsSameIgnoringOrder(new[] { o1 }, new[] { o2 }, "{0} message", "custom"));
            Assert.Count(1, failures);
            Assert.AreEqual("custom message", failures[0].Message);
        }
        public void AreElementsSameIgnoringOrder_with_different_types()
        {
            var o1 = new object();
            var o2 = new object();
            var o3 = new object();

            Assert.AreElementsSameIgnoringOrder(new[] { o2, o2, o3, o1 }, new List <object> {
                o1, o3, o2, o2
            });
        }
        public void AreElementsSameIgnoringOrder_fails_when_excess_or_missing_elements()
        {
            var o1 = new object();
            var o2 = new object();
            var o3 = new object();
            var o4 = new object();

            AssertionFailure[] failures = Capture(()
                                                  => Assert.AreElementsSameIgnoringOrder(new[] { o1, o2, o3, o2, o3, o1 }, new List <object> {
                o4, o2, o1, o1, o4, o1, o4
            }));
            Assert.Count(1, failures);
            Assert.AreEqual("Expected elements to be referentially equal but possibly in a different order.", failures[0].Description);
        }
        public void TestProject_from_pipeline_single_name()
        {
            System.Collections.Generic.List <TestProject> listOfProjects =
                new System.Collections.Generic.List <TestProject>();
            listOfProjects.Add(
                FakeTestLinkFactory.GetTestProject(
                    "project",
                    "prj",
                    string.Empty));

            System.Collections.Generic.List <TestPlan> listOfTestPlans =
                new System.Collections.Generic.List <TestPlan>();
            listOfTestPlans.Add(
                FakeTestLinkFactory.GetTestPlan(
                    "testplan 01",
                    "notes",
                    true, // active
                    true, // is_public
                    true, // open
                    listOfProjects[0].id));
            listOfTestPlans.Add(
                FakeTestLinkFactory.GetTestPlan(
                    "testplan 02",
                    "notes",
                    true, // active
                    true, // is_public
                    true, // open
                    listOfProjects[0].id));
            listOfTestPlans.Add(
                FakeTestLinkFactory.GetTestPlan(
                    "testplan 03",
                    "notes",
                    true, // active
                    true, // is_public
                    true, // open
                    listOfProjects[0].id));

            System.Collections.Generic.List <TestPlan> resultList =
                getTestPlansFromProjectsInPipelineByName(listOfProjects, listOfTestPlans, (new string[] { "testplan 02" }), false, false);

            listOfTestPlans.RemoveAt(2);
            listOfTestPlans.RemoveAt(0);

            Assert.AreElementsSameIgnoringOrder <TestPlan>(
                listOfTestPlans,
                resultList);
        }