How to mole SPContext.Current.Site.Url
-
15-03-2021 - |
Frage
Hi I would like to mole my SPContext.Current.Site.Url. How can I do that? Tnx
Lösung
I don't have a SharePoint server installed to my workstation, so this may not work:
- Mole the Microsoft.SharePoint assembly
- 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