Tmx.TestData.AddTestCase C# (CSharp) Method

AddTestCase() static private method

static private AddTestCase ( string testCaseName, string testCaseId, string testCaseDescription, string testSuiteName, string testSuiteId, string testScenarioName, string testScenarioId, System.Guid testPlatformId, ICodeBlock testCode ) : bool
testCaseName string
testCaseId string
testCaseDescription string
testSuiteName string
testSuiteId string
testScenarioName string
testScenarioId string
testPlatformId System.Guid
testCode ICodeBlock
return bool
        internal static bool AddTestCase(
            string testCaseName,
            string testCaseId,
            string testCaseDescription,
            string testSuiteName,
            string testSuiteId,
            string testScenarioName,
            string testScenarioId,
            Guid testPlatformId,
            // 20141211
            // ScriptBlock[] testCode)
            ICodeBlock[] testCode)
        {
            bool result = false;
            
            var testSuite =
                GetTestSuite(
                    testSuiteName,
                    testSuiteId,
                    testPlatformId) ?? CurrentTestSuite;

            /*
            if (null == testSuite) { // ?? mistaken behavior ??
                
                testSuite = TestData.CurrentTestSuite;
            }
            */
            
            //var testScenario =
            //    GetTestScenario(
            //        testSuite,
            //        testScenarioName,
            //        testScenarioId,
            //        testSuiteName,
            //        testSuiteId,
            //        testPlatformId);
            
            //if (null == testScenario) { // ?? mistaken behavior ??
                
            //    testScenario = CurrentTestScenario;
            //}
            var testScenario =
                GetTestScenario(
                    testSuite,
                    testScenarioName,
                    testScenarioId,
                    testSuiteName,
                    testSuiteId,
                    testPlatformId) ?? CurrentTestScenario;

            //var testCase =
            //    new TestCase(
            //        testCaseName,
            //        testCaseId);

            //testCase.Description = testCaseDescription;
            //testCase.TestCode = testCode;
            var testCase =
                new TestCase(
                    testCaseName,
                    testCaseId)
                {
                    Description = testCaseDescription,
                    TestCode = testCode
                };

            CurrentTestCase = testCase;
            
            try {
                
                testScenario.TestCases.Add(testCase);
                result = true;
            }
            catch (Exception eFailedToAdd) {
                throw eFailedToAdd;
                //result = false;
            }
            
            return result;
        }