Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

simoncropparchived/Alt.SharePoint.Client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alt.SharePoint.Client

A clone of the SharePoint client NuGets but with the following changes

  • All public member made virtual.
  • A public parameterless constructor added to all public types.
  • Constructors of public type made public.
  • StrongNamed with a new key
  • Un-sealed

This results in the public types being mockable for unit testing purposes.

Mocking examples

Custom Mock

[Fact]
public void CustomMock()
{
    var listItem = new MockListItem
    {
        DisplayNameEx = "The Display Name"
    };
    Assert.Equal("The Display Name", listItem.DisplayName);
}

class MockListItem : ListItem
{
    public override string DisplayName => DisplayNameEx;

    public string DisplayNameEx { get; set; }
}

FakeItEasy

[Fact]
public void FakeItEasy()
{
    var listItem = A.Fake<ListItem>();
    A.CallTo(() => listItem.DisplayName)
        .Returns("The Display Name");
    Assert.Equal("The Display Name", listItem.DisplayName);
}

Source NuGets

Produce NuGets

Min variants

The .Min variants contain only Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll.

About

Mockable + testable variants of the SharePoint nugets

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages