예제 #1
0
        public TestSuiteDTO AddSubTestCaseToTestSuite(string testSuiteId, TestCaseDTO instance)
        {
            TestSuite ts = TestSuite.GetTestSuite(Int32.Parse(testSuiteId));

            if (ts != null)
            {
                ts.AddSubTestCase(instance.TestCaseId);
                return ts.ToDTO();
            }
            else
            {
                return null;
            }
        }
예제 #2
0
 public TestCaseDTO CreateTestCase(TestCaseDTO instance)
 {
     return TestCase.CreateCase(instance.ToEntity()).ToDTO();
 }
예제 #3
0
 public TestCaseDTO UpdateTestCase(string id, TestCaseDTO instance)
 {
     int testCaseId = Int32.Parse(id);
     instance.TestCaseId = testCaseId;
     return TestCase.Update(testCaseId, instance).ToDTO();
 }
예제 #4
0
파일: Core.DTO.cs 프로젝트: wangn6/rep2
        /// <summary>
        /// Invoked when <see cref="ToDTO"/> operation is about to return.
        /// </summary>
        /// <param name="dto"><see cref="TestCaseDTO"/> converted from <see cref="TestCase"/>.</param>
partial         static void OnDTO(this TestCase entity, TestCaseDTO dto);
예제 #5
0
파일: Core.DTO.cs 프로젝트: wangn6/rep2
        /// <summary>
        /// Converts this instance of <see cref="TestCase"/> to an instance of <see cref="TestCaseDTO"/>.
        /// </summary>
        /// <param name="entity"><see cref="TestCase"/> to convert.</param>
        public static TestCaseDTO ToDTO(this TestCase entity)
        {
            if (entity == null) return null;

            var dto = new TestCaseDTO();

            dto.TestCaseId = entity.TestCaseId;
            dto.SourceId = entity.SourceId;
            dto.Name = entity.Name;
            dto.ProductId = entity.ProductId;
            dto.Feature = entity.Feature;
            dto.ScriptPath = entity.ScriptPath;
            dto.Weight = entity.Weight;
            dto.Ranking = entity.Ranking;
            dto.Release = entity.Release;
            dto.IsAutomated = entity.IsAutomated;
            dto.CreateBy = entity.CreateBy;
            dto.CreateTime = entity.CreateTime;
            dto.ModifyBy = entity.ModifyBy;
            dto.ModifyTime = entity.ModifyTime;
            dto.Description = entity.Description;

            entity.OnDTO(dto);

            return dto;
        }