Telerik JustMock
[TestMethod]
public
void
PreviewOnHowToMockSPContext()
{
// Arrange
var fakeSiteUrl =
"https://www.telerik.com"
;
var fakeSharepointSite = Mock.Create<SPSite>();
Mock.Arrange(() => SPContext.Current.Site).Returns(fakeSharepointSite);
Mock.Arrange(() => fakeSharepointSite.Url).Returns(fakeSiteUrl);
// Act
string
actualUrl = Site.GetHomePageUrl();
Assert.AreEqual(fakeSiteUrl, actualUrl);
}