Compile error while combining two variables to a string

2 posts, 0 answers
  1. Jiyoon
    Jiyoon avatar
    1 posts
    Member since:
    Jun 2018

    Posted 20 Jul Link to this post

    I have a line of code to combine two variables:

    string expectedValue = $"{testVariable1}-{testVariable2}";

    This works fine when I execute this from Visual Studio plug-in but I get an compile error in Test Studio with a message, ": error CS1056: Unexpected character '$'".  Is this a known issue?

     

    Thanks,

    -Jiyoon

  2. Elena Tsvetkova
    Admin
    Elena Tsvetkova avatar
    942 posts

    Posted 25 Jul Link to this post

    Hi Jiyoon,

    Thank you for reaching us out. 

    The reason you have encountered that error is that Test Studio and Visual Studio compile the code with different engines. To be able to compile that code with Test Studio you will need to downgrade it to be compatible with C#5. 

    I hope this is helpful for you! 

    Regards,
    Elena Tsvetkova
    Progress Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top