Progress Telerik JustMock

Mock Microsoft SharePoint API

Nasa, Visa, Microsoft Fox, Samsung, IBM World Bank Group, Volvo
  • Mocking Microsoft SharePoint API Overview

    SharePoint is a web-based collaborative platform and a secure place to store, organize, share and access information from any device.

    JustMock allows you to test your code in isolation by enabling you to mock any dependency, including Microsoft SharePoint API.

    [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);
    }

    Mock Microsoft Sharepoint documentation
Background-NextSteps

Next Steps

See Plans & Pricing

Purchase individual products or any of the bundles

Download Free Trial

With dedicated technical support.