public void UpdateRegressionSuiteTest()
        {
            const string addonForName = "updated";

            var regressionPlan  = EntityFactory.CreateRegressionPlan("Name", SandboxProject);
            var regressionSuite = EntityFactory.CreateRegressionSuite(RegressionSuiteName, regressionPlan);

            ResetInstance();

            var member             = EntityFactory.CreateMember("test user");
            var regressionSuiteNew = Instance.Get.RegressionSuiteByID(regressionSuite.ID);

            regressionSuiteNew.Name        = RegressionSuiteName + addonForName;
            regressionSuiteNew.Description = RegressionSuiteDescription;
            regressionSuiteNew.Reference   = RegressionSuiteReference;
            regressionSuiteNew.Owner       = member;
            regressionSuiteNew.Save();

            ResetInstance();

            regressionSuite = Instance.Get.RegressionSuiteByID(regressionSuite.ID);
            Assert.AreEqual(RegressionSuiteName + addonForName, regressionSuite.Name);
            Assert.AreEqual(RegressionSuiteDescription, regressionSuite.Description);
            Assert.AreEqual(RegressionSuiteReference, regressionSuite.Reference);
            Assert.AreEqual(member, regressionSuite.Owner);
        }
Exemple #2
0
        public void GetRegressionPlanWithValuableFilterTest()
        {
            var owner  = EntityFactory.CreateMember("Paul");
            var nobody = EntityFactory.CreateMember("Mike");

            var attributes = new Dictionary <string, object> {
                { "Owner", owner.ID.Token }
            };

            var plan = EntityFactory.CreateRegressionPlan(RegressionPlanName, SandboxProject, attributes);

            var filter = new RegressionPlanFilter();

            filter.Owners.Add(owner);
            var plans = SandboxProject.GetRegressionPlans(filter);

            Assert.AreEqual(1, plans.Count);
            CollectionAssert.Contains(plans, plan);

            filter = new RegressionPlanFilter();
            filter.Project.Add(SandboxProject);
            filter.Owners.Add(nobody);
            plans = SandboxProject.GetRegressionPlans(filter);
            Assert.AreEqual(0, plans.Count);
        }
Exemple #3
0
        public void CanNotReactivateTest()
        {
            var regressionPlan = EntityFactory.CreateRegressionPlan(RegressionPlanName, SandboxProject);

            Assert.IsFalse(regressionPlan.CanReactivate);
            regressionPlan.Reactivate();
        }
        public void CreateRegressionSuiteTest()
        {
            var regressionPlan  = EntityFactory.CreateRegressionPlan("Name", SandboxProject);
            var regressionSuite = EntityFactory.CreateRegressionSuite(RegressionSuiteName, regressionPlan);

            Assert.AreEqual(RegressionSuiteName, regressionSuite.Name);
            Assert.AreEqual(regressionPlan, regressionSuite.RegressionPlan);
        }
        public void CanNotReactivateTest()
        {
            var regressionPlan  = EntityFactory.CreateRegressionPlan("Name", SandboxProject);
            var regressionSuite = EntityFactory.CreateRegressionSuite(RegressionSuiteName, regressionPlan);

            Assert.IsFalse(regressionSuite.CanReactivate);
            regressionSuite.Reactivate();
        }
Exemple #6
0
        public void CreateTestSetWithInvalidParameters()
        {
            var subProject      = EntityFactory.Create(() => SandboxProject.CreateSubProject("subproject", DateTime.Now));
            var regressionPlan  = EntityFactory.CreateRegressionPlan(RegressionPlanName, SandboxProject);
            var regressionSuite = EntityFactory.CreateRegressionSuite("suite1", regressionPlan);

            EntityFactory.Create(() => subProject.CreateTestSet("my test set", regressionSuite));
        }
Exemple #7
0
        public void GetRegressionPlanWithNullFilterTest()
        {
            var plans        = SandboxProject.GetRegressionPlans(null);
            var plan         = EntityFactory.CreateRegressionPlan(RegressionPlanName, SandboxProject);
            var updatedPlans = SandboxProject.GetRegressionPlans(null);

            Assert.AreEqual(1, updatedPlans.Count - plans.Count);
            CollectionAssert.Contains(updatedPlans, plan);
        }
Exemple #8
0
        public void GetRegressionPlanFromMismatchingProjectTest()
        {
            var project = EntityFactory.Create(() => Instance.Create.Project("other", SandboxProject.ParentProject,
                                                                             DateTime.Now, SandboxSchedule));

            var plan  = EntityFactory.CreateRegressionPlan(RegressionPlanName, SandboxProject);
            var plans = project.GetRegressionPlans(null);

            Assert.AreEqual(0, plans.Count);
            CollectionAssert.DoesNotContain(plans, plan);
        }
Exemple #9
0
        public void CanNotCloseTest()
        {
            var regressionPlan = EntityFactory.CreateRegressionPlan(RegressionPlanName, SandboxProject);

            Assert.IsTrue(regressionPlan.IsActive);
            Assert.IsFalse(regressionPlan.IsClosed);

            Assert.IsFalse(regressionPlan.CanClose);
            Assert.IsTrue(regressionPlan.CanDelete);

            regressionPlan.Close();
        }
        public void UnassignUnrelatedRegressionTestTest()
        {
            var regressionPlan   = EntityFactory.CreateRegressionPlan("Name", SandboxProject);
            var regressionSuite1 = EntityFactory.CreateRegressionSuite("suite 1", regressionPlan);
            var regressionSuite2 = EntityFactory.CreateRegressionSuite("suite 2", regressionPlan);

            var test = EntityFactory.CreateRegressionTest("my test", SandboxProject);

            regressionSuite1.AssignRegressionTest(test);

            ResetInstance();

            regressionSuite2.UnassignRegressionTest(test);
        }
        public void UnassignRegressionTest()
        {
            const string regressionTestName = "regression test for unassign N";

            var regressionTests = new List <RegressionTest>(4);
            var regressionPlan  = EntityFactory.CreateRegressionPlan("Name", SandboxProject);
            var regressionSuite = EntityFactory.CreateRegressionSuite(RegressionSuiteName, regressionPlan);

            // create 4 and assign 3 regression tests
            for (var i = 0; i < 4; i++)
            {
                var regTest = EntityFactory.CreateRegressionTest(regressionTestName + i, SandboxProject);
                regressionTests.Add(regTest);

                // assign all regression tests except 4th
                if (i != 3)
                {
                    regressionSuite.AssignRegressionTest(regTest);
                }
            }
            regressionSuite.Save();

            ResetInstance();

            var regressionSuiteNew = Instance.Get.RegressionSuiteByID(regressionSuite.ID);

            Assert.AreEqual(3, regressionSuiteNew.RegressionTests.Count);

            // unassign 3 regression tests
            for (var i = 0; i < 3; i++)
            {
                regressionSuite.UnassignRegressionTest(regressionTests[i]);
            }

            regressionSuite.Save();

            ResetInstance();

            regressionSuiteNew = Instance.Get.RegressionSuiteByID(regressionSuite.ID);
            Assert.AreEqual(0, regressionSuiteNew.RegressionTests.Count);

            // test that all regression tests don't have info about regression suite
            for (var i = 0; i < 3; i++)
            {
                var regressionTest = Instance.Get.RegressionTestByID(regressionTests[i].ID);
                Assert.AreEqual(0, regressionTest.RegressionSuites.Count);
                CollectionAssert.DoesNotContain(regressionTest.RegressionSuites, regressionSuite);
                CollectionAssert.DoesNotContain(regressionSuite.RegressionTests, regressionTest);
            }
        }
        public void DeleteRegressionSuiteTest()
        {
            var regressionPlan  = EntityFactory.CreateRegressionPlan("Name", SandboxProject);
            var regressionSuite = EntityFactory.CreateRegressionSuite(RegressionSuiteName, regressionPlan);

            ResetInstance();

            var regressionSuiteNew = Instance.Get.RegressionSuiteByID(regressionSuite.ID);

            regressionSuiteNew.Delete();

            ResetInstance();

            regressionSuiteNew = Instance.Get.RegressionSuiteByID(regressionSuite.ID);
            Assert.IsNull(regressionSuiteNew);
        }
Exemple #13
0
        public void GetRegressionPlanFromChildProjectTest()
        {
            var childProject = EntityFactory.Create(() => SandboxProject.CreateSubProject("child", DateTime.Now));

            var plan = EntityFactory.CreateRegressionPlan(RegressionPlanName, childProject);

            var plans = SandboxProject.GetRegressionPlans(null, false);

            CollectionAssert.DoesNotContain(plans, plan);

            plans = childProject.GetRegressionPlans(null);
            CollectionAssert.Contains(plans, plan);

            plans = SandboxProject.GetRegressionPlans(null, true);
            CollectionAssert.Contains(plans, plan);
        }
Exemple #14
0
        public void RetrieveTestSetTest()
        {
            var regressionPlan  = EntityFactory.CreateRegressionPlan(RegressionPlanName, SandboxProject);
            var regressionSuite = EntityFactory.CreateRegressionSuite("suite1", regressionPlan);

            var beforeCreation = SandboxProject.GetTestSets(null);
            var testSet        = SandboxProject.CreateTestSet("my test set", regressionSuite);

            ResetInstance();

            var afterCreation = new List <TestSet>(SandboxProject.GetTestSets(null));

            CollectionAssert.Contains(afterCreation, testSet);
            CollectionAssert.DoesNotContain(beforeCreation, testSet);
            Assert.IsTrue(afterCreation.Count - beforeCreation.Count == 1);
        }
        public void CreateTestSetTest()
        {
            var regressionPlan  = EntityFactory.CreateRegressionPlan("Name", SandboxProject);
            var regressionSuite = EntityFactory.CreateRegressionSuite(RegressionSuiteName, regressionPlan);
            var testSet         = EntityFactory.Create(() => regressionSuite.CreateTestSet(TestSetName));

            ResetInstance();

            var filter = new TestSetFilter();

            filter.RegressionSuite.Add(regressionSuite);
            var testSets = new List <TestSet>(Instance.Get.TestSets(filter));

            CollectionAssert.Contains(testSets, testSet);
            Assert.IsTrue(testSets[0].RegressionSuite.Equals(regressionSuite));
        }
Exemple #16
0
        public void CreateRegressionPlanWithAttributes()
        {
            var member = EntityFactory.CreateMember("test user");

            var attributes = new Dictionary <string, object> {
                { "Description", Description },
                { "Reference", Reference },
                { "Owner", Oid.FromToken(member.ID, Instance.ApiClient.MetaModel) }
            };
            var regressionPlan = EntityFactory.CreateRegressionPlan(RegressionPlanName, SandboxProject, attributes);

            Assert.AreEqual(RegressionPlanName, regressionPlan.Name);
            Assert.AreEqual(Description, regressionPlan.Description);
            Assert.AreEqual(Reference, regressionPlan.Reference);
            Assert.AreEqual(member, regressionPlan.Owner);
        }
Exemple #17
0
        public void CreateTestSetTest()
        {
            var regressionPlan  = EntityFactory.CreateRegressionPlan(RegressionPlanName, SandboxProject);
            var regressionSuite = EntityFactory.CreateRegressionSuite("suite1", regressionPlan);

            var attributes = new Dictionary <string, object> {
                { "Description", TestSetDescription }
            };
            var testSet = SandboxProject.CreateTestSet("my test set", regressionSuite, attributes);

            ResetInstance();

            var testSets = new List <TestSet>(regressionSuite.GetTestSets(null));

            CollectionAssert.Contains(testSets, testSet);
            Assert.IsTrue(testSets[0].Project.Equals(SandboxProject));
        }
Exemple #18
0
        public void RetrieveTestSetFromChildProjectTest()
        {
            var subProject      = EntityFactory.Create(() => SandboxProject.CreateSubProject("subproject", DateTime.Now));
            var regressionPlan  = EntityFactory.CreateRegressionPlan(RegressionPlanName, subProject);
            var regressionSuite = EntityFactory.CreateRegressionSuite("suite1", regressionPlan);

            var testSet = EntityFactory.Create(() => subProject.CreateTestSet("my test set", regressionSuite));

            ResetInstance();

            var testSetsFromSandboxProject            = SandboxProject.GetTestSets(null);
            var testSetsFromChildProject              = subProject.GetTestSets(null);
            var testSetsFromSandboxProjectAndChildren = SandboxProject.GetTestSets(null, true);

            CollectionAssert.Contains(testSetsFromSandboxProjectAndChildren, testSet);
            CollectionAssert.Contains(testSetsFromChildProject, testSet);
            CollectionAssert.DoesNotContain(testSetsFromSandboxProject, testSet);
        }
        public void AssignRegressionTest()
        {
            const string regressionTestName = "regression test for assign N";

            var regressionTests = new List <RegressionTest>(4);

            // create 4 regression tests
            for (var i = 0; i < 4; i++)
            {
                regressionTests.Add(EntityFactory.CreateRegressionTest(regressionTestName + i, SandboxProject));
            }

            var regressionPlan  = EntityFactory.CreateRegressionPlan("Name", SandboxProject);
            var regressionSuite = EntityFactory.CreateRegressionSuite(RegressionSuiteName, regressionPlan);

            Assert.AreEqual(0, regressionSuite.RegressionTests.Count);
            // assign 3 regression tests
            for (var i = 0; i < 3; i++)
            {
                regressionSuite.AssignRegressionTest(regressionTests[i]);
            }
            regressionSuite.Save();
            Assert.AreEqual(3, regressionSuite.RegressionTests.Count);

            ResetInstance();

            var regressionSuiteNew = Instance.Get.RegressionSuiteByID(regressionSuite.ID);

            Assert.AreEqual(3, regressionSuiteNew.RegressionTests.Count);

            // test that 3 regression tests have info about regression suite
            for (var i = 0; i < 3; i++)
            {
                var regressionTest = Instance.Get.RegressionTestByID(regressionTests[i].ID);
                Assert.AreEqual(1, regressionTest.RegressionSuites.Count);
                CollectionAssert.Contains(regressionTest.RegressionSuites, regressionSuite);
                CollectionAssert.Contains(regressionSuite.RegressionTests, regressionTest);
            }

            var regressionTestNotAssigned = Instance.Get.RegressionTestByID(regressionTests[3].ID);

            CollectionAssert.DoesNotContain(regressionSuite.RegressionTests, regressionTestNotAssigned);
        }
        public void AssignUnassignRegressionCachingTest()
        {
            const string regressionTestName = "regression test for caching N";

            var regressionTests = new List <RegressionTest>(4);
            var regressionPlan  = EntityFactory.CreateRegressionPlan("Name", SandboxProject);
            var regressionSuite = EntityFactory.CreateRegressionSuite(RegressionSuiteName, regressionPlan);

            // create and assign 4 regression tests
            for (var i = 0; i < 4; i++)
            {
                var regTest = EntityFactory.CreateRegressionTest(regressionTestName + i, SandboxProject);
                regressionTests.Add(regTest);
                regressionSuite.AssignRegressionTest(regTest);
            }

            ResetInstance();

            var regressionSuiteNew = Instance.Get.RegressionSuiteByID(regressionSuite.ID);

            Assert.AreEqual(4, regressionSuiteNew.RegressionTests.Count);

            //all regression tests assigned to regression suite
            for (var i = 0; i < 4; i++)
            {
                Assert.AreEqual(1, regressionTests[i].RegressionSuites.Count);
            }

            // unassign 2 regression tests
            for (var i = 0; i < 2; i++)
            {
                regressionSuite.UnassignRegressionTest(regressionTests[i]);
            }

            Assert.AreEqual(0, regressionTests[0].RegressionSuites.Count);
            Assert.AreEqual(0, regressionTests[1].RegressionSuites.Count);
            Assert.AreEqual(1, regressionTests[2].RegressionSuites.Count);
            Assert.AreEqual(1, regressionTests[3].RegressionSuites.Count);
            Assert.AreEqual(2, regressionSuite.RegressionTests.Count);
        }
        public void CreateRegressionSuiteWithAttributes()
        {
            var member         = EntityFactory.CreateMember("test user");
            var regressionPlan = EntityFactory.CreateRegressionPlan("Name", SandboxProject);
            var attributes     = new Dictionary <string, object> {
                { "Description", RegressionSuiteDescription },
                { "Reference", RegressionSuiteReference },
                { "Owner", member.ID.Token }
            };
            var regressionSuite = EntityFactory.CreateRegressionSuite(RegressionSuiteName, regressionPlan, attributes);

            Assert.AreEqual(RegressionSuiteName, regressionSuite.Name);
            Assert.AreEqual(RegressionSuiteDescription, regressionSuite.Description);
            Assert.AreEqual(RegressionSuiteReference, regressionSuite.Reference);
            Assert.AreEqual(member, regressionSuite.Owner);

            ResetInstance();
            var regressionSuiteNew = Instance.Get.RegressionSuiteByID(regressionSuite.ID);

            Assert.AreEqual(RegressionSuiteName, regressionSuiteNew.Name);
            Assert.AreEqual(RegressionSuiteDescription, regressionSuiteNew.Description);
            Assert.AreEqual(RegressionSuiteReference, regressionSuiteNew.Reference);
            Assert.AreEqual(member, regressionSuiteNew.Owner);
        }
Exemple #22
0
        public RegressionSuite GetRegressionSuite()
        {
            var regressionPlan = EntityFactory.CreateRegressionPlan("test plan", SandboxProject);

            return(EntityFactory.CreateRegressionSuite("suite 1", regressionPlan));
        }
Exemple #23
0
        public void CreateRegressionPlan()
        {
            var regressionPlan = EntityFactory.CreateRegressionPlan(RegressionPlanName, SandboxProject);

            Assert.AreEqual(RegressionPlanName, regressionPlan.Name);
        }