Skip to content

Commit d64f35f

Browse files
committed
Add preliminary Win/Nix switch
1 parent 3e17340 commit d64f35f

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System;
2+
3+
namespace System.IO.Abstractions.TestingHelpers
4+
{
5+
public static class XFS
6+
{
7+
public static string ForWin(string path)
8+
{
9+
return path;
10+
}
11+
12+
public static string ForUnix(this string path, string unixPath)
13+
{
14+
int p = (int) Environment.OSVersion.Platform;
15+
bool isUnix = (p == 4) || (p == 6) || (p == 128);
16+
17+
return isUnix ? unixPath : path;
18+
}
19+
}
20+
}

TestingHelpers/TestingHelpers.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
55
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6-
<ProductVersion>9.0.30729</ProductVersion>
7-
<SchemaVersion>2.0</SchemaVersion>
86
<ProjectGuid>{251BD5E5-8133-47A4-AB19-17CF0F43D6AE}</ProjectGuid>
97
<OutputType>Library</OutputType>
108
<AppDesignerFolder>Properties</AppDesignerFolder>
@@ -43,7 +41,6 @@
4341
<ErrorReport>prompt</ErrorReport>
4442
<WarningLevel>4</WarningLevel>
4543
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
46-
<SignAssembly>false</SignAssembly>
4744
</PropertyGroup>
4845
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
4946
<DebugType>pdbonly</DebugType>
@@ -79,6 +76,7 @@
7976
<Compile Include="MockPath.cs" />
8077
<Compile Include="Properties\AssemblyInfo.cs" />
8178
<Compile Include="StringExtensions.cs" />
79+
<Compile Include="CrossPlatformExtensions.cs" />
8280
</ItemGroup>
8381
<ItemGroup>
8482
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">

0 commit comments

Comments
 (0)