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
Post a Comment