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 -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -