Skip to content

Test Implementation for Path.GetRelativePath #773

@zach-delong

Description

@zach-delong

Is your feature request related to a problem? Please describe.
I am trying to implement a static site generator, and one of the tasks I need to do is adjust file paths handed to me to be relative to the root of the "static site" I am trying to create. This is something that Microsoft makes available via Path.GetRelativePath, and the normal implementation of it in System.IO.Abstractions seems to work great, but the Mock implementation is not being overwritten so the result is strange.

Describe the solution you'd like
I think it should be possible to write some kind of mock implementation that would use the mock file system as reference.

Describe alternatives you've considered
I could probably also implement this as a specific mock for my project, but wanted to see if this was something the community had an interest in.

Additional context
If desired, my plan is to start prototyping this out today, but I can't make any promises on how fast it'll go.

This is the example code that I need to "mock" the behavior of and this is a prototype test that currently behaves very strangely because of the GetRelativePath mock implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: testinghelpersIssues that address the testing helpersstate: ready to pickIssues that are ready for being worked ontype: enhancementIssues that propose new functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions