I have a method that accepts argument RewriteContext rewrite, but then it accesses:
context.HttpContext.Request.PathBase.Value?.Replace('\\', '/')
To test it I create:
Mock<RewriteContext> rewriteContextMock = new Mock<RewriteContext>();
but then how do I setup this context.HttpContext.Request.PathBase.Value? to just return a given string? Do I have to mock everything in between:
- HttpContext
- HttpRequest
- PathBase
?
Aucun commentaire:
Enregistrer un commentaire