예제 #1
0
        public void CreateRegressionTestWithAttributesTest()
        {
            const string regressionTestName        = "Regression Test from Project";
            const string regressionTestDescription = "Regression Test from Project regressionTestDescription";
            const string regressionTestTags        = "test tags regression";

            var attributes = new Dictionary <string, object> {
                { "Description", regressionTestDescription },
                { "Tags", regressionTestTags }
            };

            var subProject     = EntityFactory.Create(() => SandboxProject.CreateSubProject("subproject", DateTime.Now));
            var regressionTest = subProject.CreateRegressionTest(regressionTestName, attributes);

            EntityFactory.RegisterForDisposal(regressionTest);

            ResetInstance();

            var regressionTestNew = Instance.Get.RegressionTestByID(regressionTest.ID);

            Assert.AreEqual(regressionTestName, regressionTestNew.Name);
            Assert.AreEqual(0, regressionTestNew.Owners.Count);
            Assert.AreEqual(regressionTestTags, regressionTestNew.Tags);
            Assert.AreEqual(regressionTestDescription, regressionTestNew.Description);
        }
예제 #2
0
        public void CreateRegressionTestTest()
        {
            const string regressionTestName = "Regression Test from Project";

            var subProject     = EntityFactory.Create(() => SandboxProject.CreateSubProject("subproject", DateTime.Now));
            var regressionTest = subProject.CreateRegressionTest(regressionTestName);

            EntityFactory.RegisterForDisposal(regressionTest);

            ResetInstance();

            var regressionTestNew = Instance.Get.RegressionTestByID(regressionTest.ID);

            Assert.AreEqual(regressionTestName, regressionTestNew.Name);
            Assert.AreEqual(subProject, regressionTestNew.Project);
        }
        public void GenerateRegressionTest()
        {
            const string storyName = "story name";
            const string testName  = "test name";

            var story          = EntityFactory.CreateStory(storyName, SandboxProject);
            var test           = EntityFactory.CreateTest(testName, story);
            var regressionTest = test.GenerateRegressionTest();

            EntityFactory.RegisterForDisposal(regressionTest);

            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 = test.GenerateRegressionTest();

            EntityFactory.RegisterForDisposal(regressionTest2);
            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);
        }