Frage

Hi I would like to mole my SPContext.Current.Site.Url. How can I do that? Tnx

War es hilfreich?

Lösung

I don't have a SharePoint server installed to my workstation, so this may not work:

  1. Mole the Microsoft.SharePoint assembly
  2. Detour the SPContext class:
Microsoft.SharePoint.Moles.MSPContext.AllInstances.Current.Site.Url = 
    testContextInstance => "www.tempuri.org/Default.aspx";
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top