Skip to content

Commit c810137

Browse files
vbreussvbtig
andauthored
fix: update version of TestableIO.System.IO.Abstractions to "17.*" (#27)
* Update version to 17.* * Use TestableIO references * Update build pipelines to setup required .NET versions Co-authored-by: Valentin Breuß <[email protected]>
1 parent 8d51e78 commit c810137

File tree

8 files changed

+30
-30
lines changed

8 files changed

+30
-30
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@ jobs:
1717
uses: actions/checkout@v3
1818
with:
1919
fetch-depth: 0
20-
- name: Setup .NET Core 2.1
21-
uses: actions/setup-dotnet@v2
22-
with:
23-
dotnet-version: "2.1.x"
24-
- name: Setup .NET Core 3.1
25-
uses: actions/setup-dotnet@v2
20+
- name: Setup .NET
21+
uses: actions/setup-dotnet@v3
2622
with:
27-
dotnet-version: "3.1.x"
23+
dotnet-version: |
24+
3.1.x
25+
5.0.x
26+
6.0.x
2827
- name: Setup .NET
2928
uses: actions/setup-dotnet@v2
3029
- name: Run tests

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<DefineConstants Condition="'$(TargetFramework)' == 'net5.0'">$(DefineConstants);FEATURE_FILE_SYSTEM_WATCHER_FILTERS</DefineConstants>
2323
</PropertyGroup>
2424
<ItemGroup>
25-
<PackageReference Include="System.IO.Abstractions" Version="13.*" />
25+
<PackageReference Include="TestableIO.System.IO.Abstractions" Version="17.*" />
2626
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.255">
2727
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
2828
<PrivateAssets>all</PrivateAssets>

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "5.0.100",
4-
"rollForward": "latestFeature"
3+
"version": "6.0.403",
4+
"rollForward": "latestMinor"
55
}
66
}

src/System.IO.Abstractions.Extensions/IDirectoryInfoExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public static class IDirectoryInfoExtensions
1010
/// <returns>An <see cref="IDirectoryInfo"/> for the specified sub-directory</returns>
1111
public static IDirectoryInfo SubDirectory(this IDirectoryInfo info, string name)
1212
{
13-
return info.FileSystem.DirectoryInfo.FromDirectoryName(info.FileSystem.Path.Combine(info.FullName, name));
13+
return info.FileSystem.DirectoryInfo.New(info.FileSystem.Path.Combine(info.FullName, name));
1414
}
1515

1616
/// <summary>
@@ -21,7 +21,7 @@ public static IDirectoryInfo SubDirectory(this IDirectoryInfo info, string name)
2121
/// <returns>An <see cref="IFileInfo"/> for the specified file</returns>
2222
public static IFileInfo File(this IDirectoryInfo info, string name)
2323
{
24-
return info.FileSystem.FileInfo.FromFileName(info.FileSystem.Path.Combine(info.FullName, name));
24+
return info.FileSystem.FileInfo.New(info.FileSystem.Path.Combine(info.FullName, name));
2525
}
2626
}
2727
}

src/System.IO.Abstractions.Extensions/IFileSystemExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public static class IFileSystemExtensions
99
/// <returns>An <see cref="IDirectoryInfo"/> for the current directory</returns>
1010
public static IDirectoryInfo CurrentDirectory(this IFileSystem fileSystem)
1111
{
12-
return fileSystem.DirectoryInfo.FromDirectoryName(fileSystem.Directory.GetCurrentDirectory());
12+
return fileSystem.DirectoryInfo.New(fileSystem.Directory.GetCurrentDirectory());
1313
}
1414
}
1515
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<PackageId>TestableIO.System.IO.Abstractions.Extensions</PackageId>
5-
<TargetFrameworks>net5.0;netstandard2.1;netstandard2.0;net461</TargetFrameworks>
6-
<Description>Convenience functionalities on top of System.IO.Abstractions</Description>
7-
</PropertyGroup>
3+
<PropertyGroup>
4+
<PackageId>TestableIO.System.IO.Abstractions.Extensions</PackageId>
5+
<TargetFrameworks>net6.0;net5.0;netstandard2.1;netstandard2.0;net461</TargetFrameworks>
6+
<Description>Convenience functionalities on top of System.IO.Abstractions</Description>
7+
</PropertyGroup>
88

99
</Project>

tests/System.IO.Abstractions.Extensions.Tests/DirectoryInfoExtensionsTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public void SubDirectory_Extension_Test()
1010
{
1111
//arrange
1212
var fs = new FileSystem();
13-
var current = fs.DirectoryInfo.FromDirectoryName(fs.Directory.GetCurrentDirectory());
13+
var current = fs.DirectoryInfo.New(fs.Directory.GetCurrentDirectory());
1414
var guid = Guid.NewGuid().ToString();
1515
var expectedPath = fs.Path.Combine(current.FullName, guid);
1616

@@ -35,7 +35,7 @@ public void File_Extension_Test()
3535
{
3636
//arrange
3737
var fs = new FileSystem();
38-
var current = fs.DirectoryInfo.FromDirectoryName(fs.Directory.GetCurrentDirectory());
38+
var current = fs.DirectoryInfo.New(fs.Directory.GetCurrentDirectory());
3939
var guid = Guid.NewGuid().ToString();
4040
var expectedPath = fs.Path.Combine(current.FullName, guid);
4141

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFrameworks>net5.0;netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
5-
<TargetFrameworks Condition="!$([MSBuild]::IsOsUnixLike())">$(TargetFrameworks);net461</TargetFrameworks>
6-
<IsPackable>false</IsPackable>
7-
<IsTestable>true</IsTestable>
8-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1</TargetFrameworks>
5+
<TargetFrameworks Condition="!$([MSBuild]::IsOsUnixLike())">$(TargetFrameworks);net461</TargetFrameworks>
6+
<IsPackable>false</IsPackable>
7+
<IsTestable>true</IsTestable>
8+
</PropertyGroup>
99

10-
<ItemGroup>
11-
<ProjectReference Include="..\..\src\System.IO.Abstractions.Extensions\System.IO.Abstractions.Extensions.csproj" />
12-
</ItemGroup>
10+
<ItemGroup>
11+
<PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers" Version="17.*" />
12+
<ProjectReference Include="..\..\src\System.IO.Abstractions.Extensions\System.IO.Abstractions.Extensions.csproj" />
13+
</ItemGroup>
1314

1415
</Project>

0 commit comments

Comments
 (0)