Exemple #1
0
        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 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 #3
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 #4
0
        public void DeleteExpressionAuthoredByAnotherUser()
        {
            Member     author     = EntityFactory.CreateMember("ConversationAuthor");
            Expression expression = CreateDisposableExpression(author, "A disposable expression");

            AssetID id = expression.ID;

            Expression persistedExpression = Instance.Get.ExpressionByID(id);

            Assert.IsNotNull(persistedExpression);

            persistedExpression.Delete();
        }
Exemple #5
0
        public void CreateExpression()
        {
            string     expressionContent = "testing expression creation";
            Member     author            = EntityFactory.CreateMember("test");
            Expression expression        = CreateDisposableExpression(author, expressionContent);

            expression.Save();
            ResetInstance();

            Expression newExpression = Instance.Get.ExpressionByID(expression.ID);

            Assert.AreEqual(author, newExpression.Author);
            Assert.AreEqual(expressionContent, newExpression.Content);
        }
Exemple #6
0
        public void CreateRegressionPlanWithAttributesTest()
        {
            var member     = EntityFactory.CreateMember("test user");
            var attributes = new Dictionary <string, object> {
                { "Description", RegressionPlanDescription },
                { "Owner", Oid.FromToken(member.ID, Instance.ApiClient.MetaModel) }
            };
            var regressionPlan = EntityFactory.Create(() => SandboxProject.CreateRegressionPlan(RegressionPlanName, attributes));

            Assert.AreEqual(SandboxProject, regressionPlan.Project);
            Assert.AreEqual(RegressionPlanName, regressionPlan.Name);
            Assert.AreEqual(RegressionPlanDescription, regressionPlan.Description);
            Assert.AreEqual(member, regressionPlan.Owner);
        }
        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);
        }
Exemple #8
0
        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 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);
        }