Open
Description
Category
- Bug
Describe the bug
The IPnPContextFactory interface has create methods returning concretions and, as discussed elsewhere, PnPContext only has internal constructors meaning that setting up responses for Create calls is problematic.
Steps to reproduce
For example, the following snippet will fail:
// some code
_contextFactory.Setup(x =>
x.CreateAsync(new Uri(SharepointBaseUri), new WrappedTokenProvider(SharepointToken), null))
.Returns(Task.FromResult(ctx.Object));
// some code
Expected behavior
As PnPContext implements the IPnPContext interface, I would expect the Create method calls on IPnPContextFactory to return abstractions and not concretions thereby allowing for unit testing of code consuming these classes.