public void CopyAcceptanceTestsFromRegressionSuiteTest() { const string firstTestName = "test 1"; const string secondTestName = "test 2"; var regressionSuite = GetRegressionSuite(); var firstTest = EntityFactory.CreateRegressionTest(firstTestName, SandboxProject); var secondTest = EntityFactory.CreateRegressionTest(secondTestName, SandboxProject); regressionSuite.RegressionTests.Add(firstTest); regressionSuite.RegressionTests.Add(secondTest); var testSet = EntityFactory.CreateTestSet(TestSetName, regressionSuite); testSet.CopyAcceptanceTestsFromRegressionSuite(); ResetInstance(); var filter = new TestFilter(); filter.Parent.Add(testSet); var createdTests = Instance.Get.Tests(filter); Assert.AreEqual(2, createdTests.Count); Assert.IsTrue(ContainsRegressionTestReference(createdTests, firstTest)); Assert.IsTrue(ContainsRegressionTestReference(createdTests, secondTest)); }
public void CreateWithAttributes() { const string tags = "test tag regression"; var attributes = new Dictionary <string, object> { { "Tags", tags } }; var regressionTest = EntityFactory.CreateRegressionTest(RegressionPlanName, SandboxProject, attributes); Assert.AreEqual(RegressionPlanName, regressionTest.Name); var member1 = EntityFactory.CreateMember("member name 1"); var member2 = EntityFactory.CreateMember("member name 2"); regressionTest.Owners.Add(member1); regressionTest.Owners.Add(member2); regressionTest.Save(); ResetInstance(); var regressionTestNew = Instance.Get.RegressionTestByID(regressionTest.ID); Assert.AreEqual(RegressionPlanName, regressionTestNew.Name); Assert.AreEqual(SandboxProject, regressionTestNew.Project); Assert.AreEqual(tags, regressionTestNew.Tags); Assert.AreEqual(2, regressionTestNew.Owners.Count); }
public void CanDelete() { var regressionTest = EntityFactory.CreateRegressionTest(RegressionTestName, SandboxProject); Assert.IsTrue(regressionTest.CanDelete); regressionTest.Close(); Assert.IsFalse(regressionTest.CanDelete); }
public void Create() { var regressionTest = EntityFactory.CreateRegressionTest(RegressionPlanName, SandboxProject); Assert.AreEqual(RegressionPlanName, regressionTest.Name); ResetInstance(); var regressionTestNew = Instance.Get.RegressionTestByID(regressionTest.ID); Assert.AreEqual(RegressionPlanName, regressionTestNew.Name); Assert.AreEqual(SandboxProject, regressionTestNew.Project); }
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 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 CreateBasedOnTest() { const string storyName = "story name"; const string testName = "test name"; var story = EntityFactory.CreateStory(storyName, SandboxProject); var test = EntityFactory.CreateTest(testName, story); var regressionTest = EntityFactory.CreateRegressionTest(test); Assert.AreEqual(testName, regressionTest.Name); ResetInstance(); var regressionTestNew = Instance.Get.RegressionTestByID(regressionTest.ID); Assert.AreEqual(testName, regressionTestNew.Name); Assert.AreEqual(SandboxProject, regressionTestNew.Project); Assert.AreEqual(test, regressionTestNew.GeneratedFrom); var member1 = EntityFactory.CreateMember("member name 1"); var member2 = EntityFactory.CreateMember("member name 2"); test.Owners.Add(member1); test.Owners.Add(member2); test.Save(); var regressionTest2 = EntityFactory.CreateRegressionTest(test); Assert.AreEqual(2, regressionTest2.Owners.Count); CollectionAssert.Contains(regressionTest2.Owners, member1); CollectionAssert.Contains(regressionTest2.Owners, member2); ResetInstance(); var regressionTestNew2 = Instance.Get.RegressionTestByID(regressionTest2.ID); Assert.AreEqual(test, regressionTestNew.GeneratedFrom); Assert.AreEqual(2, regressionTestNew2.Owners.Count); CollectionAssert.Contains(regressionTest2.Owners, member1); CollectionAssert.Contains(regressionTest2.Owners, member2); }
public void Update() { const string newName = "New name"; var test = EntityFactory.CreateRegressionTest(RegressionTestName, SandboxProject); var newOwner = EntityFactory.CreateMember("user"); test.Owners.Clear(); test.Owners.Add(newOwner); test.Name = newName; test.Save(); ResetInstance(); var testWithChanges = Instance.Get.RegressionTestByID(test.ID); Assert.AreEqual(testWithChanges.Name, newName); Assert.IsTrue(testWithChanges.Owners.Count == 1); CollectionAssert.Contains(testWithChanges.Owners, newOwner); }
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); }