-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Corrigindo os testes que não estavam rodando no linux
- Loading branch information
1 parent
d46da2e
commit 6bfb58f
Showing
8 changed files
with
161 additions
and
31 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System.Runtime.InteropServices; | ||
|
||
namespace ByReplace.Common; | ||
|
||
internal class PathFixer | ||
{ | ||
public string OS | ||
{ | ||
get | ||
{ | ||
return Environment.OSVersion.ToString(); | ||
} | ||
} | ||
|
||
public string GetFixedPath(params string[] parts) | ||
{ | ||
IPathFixer linux = new PathFixerLinux(); | ||
IPathFixer windows = new PathFixerLinux(); | ||
|
||
return RuntimeInformation.IsOSPlatform(OSPlatform.Linux) | ||
? linux.PathFixed(parts) | ||
: windows.PathFixed(parts); | ||
} | ||
} | ||
|
||
internal interface IPathFixer | ||
{ | ||
string PathFixed(params string[] parts); | ||
} | ||
|
||
internal class PathFixerWindowns : IPathFixer | ||
{ | ||
public string PathFixed(params string[] parts) | ||
{ | ||
return string | ||
.Join('\\', parts) | ||
.Trim(); | ||
} | ||
} | ||
|
||
internal class PathFixerLinux : IPathFixer | ||
{ | ||
public string PathFixed(params string[] parts) | ||
{ | ||
return string | ||
.Join('/', parts) | ||
.Trim(); | ||
} | ||
} |
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
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