-
-
Save CopperStarSystems/d09eb9c999593cc43e00e295be735508 to your computer and use it in GitHub Desktop.
A simple wrapper around System.IO.Path to improve testability
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Interface for mocking | |
public interface IPathWrapper | |
{ | |
string GetFileName(string input); | |
} | |
// Wrapper over the static Path.GetFileName | |
public class PathWrapper : IPathWrapper | |
{ | |
public string GetFileName(string input) | |
{ | |
return Path.GetFileName(input); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment