locked
cannot get resource string when unit testing, HttpContext.GetGlobalResourceObject RRS feed

  • Question

  • Hi,

     

    I'm trying ti unit test a method that uses HttpContext.GetGlobalResourceObject to get a string from the resource file.

    The unit test doesn't find the resource string. I than ran the code in debug and it did find the correct string and the method worked successfully.

    Is there a way of getting the string from the resource file using unit testing?

    Thanks for any assistance

    Wednesday, July 14, 2010 12:04 PM

Answers

  • Hi

    Have you added the attribute [HostType("ASP.NET")] and [UrlToTest("...")] to your test or testclass?

    Regards

    Johan

     


    Johan van Rhyn - Please remember to mark the replies as answers if you found them helpful.
    Friday, July 30, 2010 7:24 AM