Beispiel #1
0
        static TestCase GetTestCase(DiaSessionWrapper diaSession, string source, XmlNode methodNode)
        {
            string typeName = methodNode.Attributes["type"].Value;
            string methodName = methodNode.Attributes["method"].Value;
            string displayName = methodNode.Attributes["name"].Value;
            string fullyQualifiedName = String.Format("{0}.{1}", typeName, methodName);

            TestCase testCase = new TestCase(fullyQualifiedName, uri, source)
            {
                DisplayName = GetDisplayName(displayName, methodName, fullyQualifiedName),
            };

            if (addTraitThunk != null)
                foreach (XmlNode traitNode in methodNode.SelectNodes("traits/trait"))
                {
                    string value = traitNode.Attributes["name"].Value;
                    string value2 = traitNode.Attributes["value"].Value;
                    addTraitThunk(testCase, value, value2);
                }

            DiaNavigationData navigationData = diaSession.GetNavigationData(typeName, methodName);
            if (navigationData != null)
            {
                testCase.CodeFilePath = navigationData.FileName;
                testCase.LineNumber = navigationData.MinLineNumber;
            }

            return testCase;
        }
Beispiel #2
0
        static TestCase GetTestCase(DiaSessionWrapper diaSession, string source, XmlNode methodNode)
        {
            string typeName = methodNode.Attributes["type"].Value;
            string methodName = methodNode.Attributes["method"].Value;
            string displayName = methodNode.Attributes["name"].Value;
            string fullyQualifiedName = String.Format("{0}.{1}", typeName, methodName);

            TestCase testCase = new TestCase(fullyQualifiedName, uri, source)
            {
                DisplayName = GetDisplayName(displayName, methodName, fullyQualifiedName),
            };

            DiaNavigationData navigationData = diaSession.GetNavigationData(typeName, methodName);
            if (navigationData != null)
            {
                testCase.CodeFilePath = navigationData.FileName;
                testCase.LineNumber = navigationData.MinLineNumber;
            }

            return testCase;
        }