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.
[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; }
}[Fact]
public void FakeItEasy()
{
var listItem = A.Fake<ListItem>();
A.CallTo(() => listItem.DisplayName)
.Returns("The Display Name");
Assert.Equal("The Display Name", listItem.DisplayName);
}- Alt.SharePoint2013.CSOM
- Alt.SharePoint2013.CSOM.Min
- Alt.SharePoint2016.CSOM
- Alt.SharePoint2016.CSOM.Min
- Alt.SharePointOnline.CSOM
- Alt.SharePointOnline.CSOM.Min
The .Min variants contain only Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll.