We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A primary goal of this task is to make it easy to write end to end tests without thinking about json:api.
IScopedServiceProvider
ResourceGraph
JsonApiContext
public class MockJsonApiContextFactory { public static Mock<IJsonApiContext> GetWithSingleResource<TResource, TId>() where TResource : class, IIdentifiable<TId> { var resourceGraph = new ResourceGraphBuilder() .AddResource<TResource, TId>() .Build(); var requestEntity = resourceGraph.GetContextEntity(typeof(TResource)); var jsonApiContextMock = new Mock<IJsonApiContext>(); jsonApiContextMock.Setup(c => c.ResourceGraph).Returns(resourceGraph); jsonApiContextMock.Setup(c => c.RequestEntity).Returns(requestEntity); return jsonApiContextMock; } }
test
https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/test/UnitTests/TestScopedServiceProvider.cs
The text was updated successfully, but these errors were encountered:
JsonApiContext does no longer exist. #558. This greatly improves testability.
Sorry, something went wrong.
No branches or pull requests
A primary goal of this task is to make it easy to write end to end tests without thinking about json:api.
IScopedServiceProvider
. See ScopedServiceProvider should throw helpful exception when outside HttpContext #362 for interim solution.ResourceGraph
andJsonApiContext
outside of a web request.Current workaround:
test
(or something along those lines)https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/test/UnitTests/TestScopedServiceProvider.cs
The text was updated successfully, but these errors were encountered: