Я пытаюсь получить список всех значений "methodname", "fullname" и свойства [] из сложного JSON файла, я пытался реализовать модель c basi для чтения верхнего слоя, но все возвращается как ноль;
public class TestRun
{
public string @id { get; set; }
public string @name { get; set; }
public string @fullname { get; set; }
public string testcasecount { get; set; }
public TestSuite[] TestSuite { get; set; }
}
public class TestSuite
{
}
public class ScriptModel
{
public TestRun[] TestRun { get; set; }
}
JSON выглядит так; На уровне root имеется большое количество вложенных «наборов тестов» и «тестовых приспособлений»
"test-suite": {
"@type": "TestSuite",
"@id": "0-1030",
"@name": "Example__Exampledll",
"@fullname": "Example",
"@runstate": "Runnable",
"@testcasecount": "24",
"test-suite": {
"@type": "TestSuite",
"@id": "0-1031",
"@name": "Features",
"@fullname": "Payments_Regression.Features",
"@runstate": "Runnable",
"@testcasecount": "24",
"test-suite": [
{
"@type": "TestSuite",
"@id": "0-1033",
"@name": "PRE",
"@fullname": "Payments_Regression.Features",
"@runstate": "Runnable",
"@testcasecount": "16",
"test-suite": [
{
"@type": "TestFixture",
"@id": "0-1015",
"@name": "Outwards",
"@fullname": "Example_Outwards",
"@classname": "Example_Dll_Example_Outwards",
"@runstate": "Runnable",
"@testcasecount": "8",
"properties": {
"property": [
{
"@name": "Description",
"@value": "Smoke"
},
{
"@name": "Category",
"@value": "PREPRODUCTION"
},
{
"@name": "Category",
"@value": "Payment"
}
]
},
"test-case": [
{
"@id": "0-1017",
"@name": "TestCaseNameIWantToCapture",
"@fullname": "fullnameexample",
"@methodname": "MethodNameToCapture",
"@classname": "ClassNametoCapture",
"@runstate": "Runnable",
"@seed": "1767458888",
"properties": {
"property": {
"@name": "Description",
"@value": "PropertyValueiWouldLikeToCapture."
}
}
},
.