Пример #1
0
        public static TestManual CreateManualTest()
        {
            string     name = "Test" + Guid.NewGuid();
            TestManual test = new TestManual();

            test.Name  = name;
            test.Phase = GetPhaseNew();


            TestManual created = entityService.Create <TestManual>(workspaceContext, test, TestHelper.NameSubtypeFields);

            Assert.AreEqual <string>(name, created.Name);
            Assert.IsTrue(!string.IsNullOrEmpty(created.Id));
            return(created);
        }
        /// <summary>
        /// Create a new manual test entity
        /// </summary>
        public static TestManual CreateManualTest(string customName = null)
        {
            var name = customName ?? "ManualTest_" + Guid.NewGuid();
            var test = new TestManual()
            {
                Name  = name,
                Phase = GetPhaseNew()
            };

            test.SetValue(CommonFields.Owner, BaseOctanePluginTest.User);

            var createdTest = BaseOctanePluginTest.EntityService.Create(BaseOctanePluginTest.WorkspaceContext, test, new[] { "name", "subtype" });

            Assert.AreEqual(name, createdTest.Name, "Mismatched name for newly created manual test");
            Assert.IsTrue(!string.IsNullOrEmpty(createdTest.Id), "Manual test id shouldn't be null or empty");
            return(createdTest);
        }
Пример #3
0
        public static RunManual CreateManualRun(TestManual parent, string customName = null)
        {
            var name = customName ?? "ManualRun_" + Guid.NewGuid();

            var status = new BaseEntity();

            status.SetValue("id", "list_node.run_native_status.not_completed");
            status.SetValue("type", "list_node");

            var manualRun = new RunManual
            {
                Name         = name,
                Release      = ReleaseTests.CreateRelease(),
                Parent       = parent,
                NativeStatus = status
            };

            var createdManualRun = entityService.Create(workspaceContext, manualRun, new[] { "name", "subtype" });

            Assert.AreEqual(name, createdManualRun.Name, "Mismatched name for newly created manual run");
            Assert.IsTrue(!string.IsNullOrEmpty(createdManualRun.Id), "Manual run id shouldn't be null or empty");
            return(createdManualRun);
        }