Tmx.TestData.GetTestCase C# (CSharp) Method

GetTestCase() static private method

static private GetTestCase ( ITestSuite testSuite, string testCaseName, string testCaseId, string testScenarioName, string testScenarioId, string testSuiteName, string testSuiteId, System.Guid testPlatformId ) : ITestCase
testSuite ITestSuite
testCaseName string
testCaseId string
testScenarioName string
testScenarioId string
testSuiteName string
testSuiteId string
testPlatformId System.Guid
return ITestCase
        internal static ITestCase GetTestCase(
            ITestSuite testSuite,
            string testCaseName,
            string testCaseId,
            string testScenarioName,
            string testScenarioId,
            string testSuiteName,
            string testSuiteId,
            Guid testPlatformId)
        {
            ITestCase result = null;
            
            if (null == testSuite) {
                
                testSuite =
                    GetTestSuite(
                        testSuiteName,
                        testSuiteId,
                        testPlatformId);
                
            }
            
            if (null == testSuite)
                // better error description?
                return result;
            
            ITestScenario testScenario = null;
            
            if (null != testSuite)
                testScenario =
                    GetTestScenario(
                    testSuite,
                    testScenarioName,
                    testScenarioId,
                    testSuiteName,
                    testSuiteId,
                    testPlatformId);
            
            if (null == testScenario)
                // better error description?
                return result;
            
            if (null != testScenario && 0 < testScenario.TestCases.Count)
                foreach (var testCase in testScenario.TestCases)
                    if ((testCaseName == testCase.TestCaseName &&
                        testCaseId == testCase.TestCaseId) ||
                        (string.IsNullOrEmpty(testCaseName) && testCaseId == testCase.TestCaseId) ||
                        (string.IsNullOrEmpty(testCaseId) && testCaseName == testCase.TestCaseName)) {
                        
                        result = testCase;
                        break;
                    }
            
            return result;
        }