« Previous Next »

Answered Thread: How to run ASP.NET/MVC unit test cases on IIS?

Last post 10-19-2009 6:12 AM by Leo Tang - MSFT. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 10-14-2009, 5:45 AM

    • nimi_dev
    • Not Ranked
    • Joined on 10-13-2009, 9:12 AM
    • Posts 1

    How to run ASP.NET/MVC unit test cases on IIS?

    How to run ASP.NET/MVC unit test cases to run on IIS?

    What are the steps that i need to folllow?

    when i run the test cases from the Visual Studio i need to decorate my testcases with the following attributes


            /// <summary>
            ///A test for Index
            ///</summary>
            [TestMethod()]
            [HostType("ASP.NET")]
            [AspNetDevelopmentServer("%PathToWebRoot%","%PathToWebRoot%")]
            [UrlToTest("http://localhost:4146/")]

            public void IndexTest()
                {
                }

    Here when on running on the server, can i remove those atttributes?

    How to run this and see the output? is there any work around for this? 

  • 10-19-2009, 6:12 AM In reply to

    Answered Re: How to run ASP.NET/MVC unit test cases on IIS?

    Hi,

    You can refer to the following document:

    Example 2. To test a Web site running under IIS, use only the attributes TestMethod, HostType, and UrlToTest:
    [TestMethod()]
    [HostType("ASP.NET")]
    [UrlToTest("http://localhost:25153/WebSite1")]

    For more information, please refer to:
    How to: Create an ASP.NET Unit Test
    http://msdn.microsoft.com/en-us/library/ms182526(VS.80).aspx

    Leo Tang
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (2 items)
Microsoft Communities