unit testing - How to properly extract content from object converted to string c#? -


i writing unit-tests , trying extract value httpresponsemessage. trying value resultcount. currenly string looks this:"{"resultcount":5,"works":null,"success::false,"errors"null}"

any ideas how can 'resultcount:5'

add reference project "system.web.extensions.dll". try:

var jss = new javascriptserializer(); var dict = jss.deserialize<dictionary<string, string>>("{'resultcount':5,'works':null,'success':false,'errors' : null}");  console.writeline(dict["resultcount"]); 

you need use using system.web.script.serialization;


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -