none
Problem with Unit Testing Sharepoint RRS feed

  • Question

  • Dear Community,

    I wanted to start using Test Projects for Sharepoint as of now, but I have a Problem configuring the Test Project for it.

    My TestMethod is pretty simple:

            [TestMethod()]
            [HostType("ASP.NET")]
            [UrlToTest("http://server19:12227")]
            public void CreateProjectPage()
            {
                SPWeb web = SPContext.Current.Web;
                SPWeb projectPortal = web.Webs.Add("projektportal", "Projektportal", null, 1031, web.Site.GetWebTemplates(1031)["STS#1"], false, false);
                projectPortal.Dispose();
                web.Dispose();
            }

    As you can see, I configured HostType and Url ToTest. But when I hit "Run Test", it always fails with the following errormessage:

    "The host type 'ASP.NET' cannot be loaded for the following reason: The key 'ASP.NET' cannot cannot be found."

    Can anyone tell me, what I missed out when I configured the test?
    Thanks in advance,

    SoundofSilence

    Monday, May 2, 2011 1:23 PM

Answers

All replies