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

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -