Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String with double quotes - how to put in test
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01668335
Message ID:
01668337
Views:
39
Hi Martina,

I doubled (manually) each double quote. That worked, running this test now again to confirm. UPDATE. Yes, test ran successfully.

I checked this https://stackoverflow.com/questions/3458046/how-to-include-quotes-in-a-string

I think there is something new in C# to allow long texts, need to search a bit harder.

>Hi Naomi,
>
>I don't programming in c# but, it's time to escape char.
>
>
> string expected = @"<ERR>0</ERR><STATUSCODE>0</STATUSCODE><MSG>[
>  {
>    \"descrip_a\": \"2 Hour Group Telemark    \",
>....
>
> MartinaJ
>
>>Hi everybody,
>>
>>I'm testing the JSON output I'm adding to our application. When I debug my test and then look at Text Output in the Visual Studio, I get this
>>
>> string expected = @"<ERR>0</ERR><STATUSCODE>0</STATUSCODE><MSG>[
>>  {
>>    "descrip_a": "2 Hour Group Telemark    ",
>>    "department": "LSSNS-GRP ",
>>    "category": "TELEMARK  ",
>>    "item": "2HOUR     ",
>>    "span": 120,
>>    "descrip_b": "GRP Telemark $           ",
>>    "layer": 5,
>>    "lsn_cat": "G"
>>  }
>>]</MSG>";
>>
>>
>>The problem is - how should I actually put this string in C# code? Since I have double quotes in it, it doesn't let me.
>>
>>Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform