Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ end_of_line = CRLF
[*.cs]
indent_style = space
indent_size = 4

dotnet_diagnostic.NUnit2003.severity = suggestion
dotnet_diagnostic.NUnit2004.severity = suggestion
dotnet_diagnostic.NUnit2005.severity = suggestion
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -577,3 +577,4 @@ FodyWeavers.xsd
# Additional files built by Visual Studio

# End of https://www.toptal.com/developers/gitignore/api/csharp,visualstudio,visualstudiocode
*.sh
6 changes: 3 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<LangVersion>9.0</LangVersion>
<PackageTags>testing</PackageTags>
<PackageProjectUrl>https://github.com/System-IO-Abstractions/System.IO.Abstractions.Extensions</PackageProjectUrl>
<RepositoryUrl>https://github.com/System-IO-Abstractions/System.IO.Abstractions.Extensions.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<RepositoryRoot>$(MSBuildThisFileDirectory)</RepositoryRoot>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.133">
<PackageReference Include="Nerdbank.GitVersioning" Version="3.7.115">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="SauceControl.InheritDoc" Version="2.0.1" PrivateAssets="all" />
<PackageReference Include="SauceControl.InheritDoc" Version="2.0.2" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER
#if NET8_0_OR_GREATER
#nullable enable

using System.Collections.Generic;
Expand Down Expand Up @@ -85,12 +85,12 @@ public static async IAsyncEnumerable<string> EnumerateLinesAsync(this IFileInfo
? new StreamReader(stream)
: new StreamReader(stream, encoding);

var line = await reader.ReadLineAsync();
var line = await reader.ReadLineAsync(cancellationToken);
while (line != null)
{
yield return line;
cancellationToken.ThrowIfCancellationRequested();
line = await reader.ReadLineAsync();
line = await reader.ReadLineAsync(cancellationToken);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@

<PropertyGroup>
<PackageId>TestableIO.System.IO.Abstractions.Extensions</PackageId>
<TargetFrameworks>net8.0;net6.0;netstandard2.1;netstandard2.0;net462</TargetFrameworks>
<TargetFrameworks>net8.0;netstandard2.1;netstandard2.0;net472</TargetFrameworks>
<Description>Convenience functionalities on top of System.IO.Abstractions</Description>
<RootNamespace>System.IO.Abstractions</RootNamespace>
<PackageReleaseNotes>$([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)/../../ReleaseNotes.md"))</PackageReleaseNotes>
<LangVersion>9.0</LangVersion>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)../../README.md" Pack="true" PackagePath="\"/>
</ItemGroup>

<ItemGroup>
<!-- Dependencies of TestableIO.System.IO.Abstractions changed in 22.0 -->
<PackageReference Include="TestableIO.System.IO.Abstractions" Version="[17.*,22.0.0)" />
<PackageReference Include="TestableIO.System.IO.Abstractions" Version="[22.*,)" />
</ItemGroup>

<ItemGroup>
Expand Down
9 changes: 0 additions & 9 deletions tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,4 @@
-->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="coverlet.collector" Version="6.0.1" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Snapshooter.NUnit" Version="0.13.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using NUnit.Framework;
using System.Collections.Generic;
using Assert = NUnit.Framework.Legacy.ClassicAssert;

namespace System.IO.Abstractions.Extensions.Tests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NUnit.Framework;
using Assert = NUnit.Framework.Legacy.ClassicAssert;

namespace System.IO.Abstractions.Extensions.Tests
{
Expand All @@ -8,7 +9,7 @@ public class DisposableDirectoryTests
[Test]
public void DisposableDirectory_Throws_ArgumentNullException_For_Null_IDirectoryInfo_Test()
{
Assert.Throws<ArgumentNullException>(() => new DisposableDirectory(null!));
Assert.Throws<ArgumentNullException>(() => new DisposableDirectory(null));
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NUnit.Framework;
using Assert = NUnit.Framework.Legacy.ClassicAssert;

namespace System.IO.Abstractions.Extensions.Tests
{
Expand All @@ -8,7 +9,7 @@ public class DisposableFileTests
[Test]
public void DisposableFile_Throws_ArgumentNullException_For_Null_IFileInfo_Test()
{
Assert.Throws<ArgumentNullException>(() => new DisposableFile(null!));
Assert.Throws<ArgumentNullException>(() => new DisposableFile(null));
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using NUnit.Framework;
using System.Linq;
using System.Text;
using Assert = NUnit.Framework.Legacy.ClassicAssert;

namespace System.IO.Abstractions.Extensions.Tests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NUnit.Framework;
using Assert = NUnit.Framework.Legacy.ClassicAssert;

namespace System.IO.Abstractions.Extensions.Tests
{
Expand Down Expand Up @@ -42,7 +43,7 @@ public void CurrentDirectoryTest()
var fullName = fs.CurrentDirectory().FullName;

Assert.IsFalse(String.IsNullOrWhiteSpace(fullName));
Assert.AreEqual(Environment.CurrentDirectory, fullName);
NUnit.Framework.Assert.That(fullName, Is.EqualTo(Environment.CurrentDirectory));
}

[Test]
Expand Down Expand Up @@ -119,14 +120,14 @@ public void CreateDisposableFile_Temp_Path_Test()
{
path = file.FullName;

Assert.IsTrue(file.Exists, "File should exist");
Assert.That(file.Exists, Is.True, "File should exist");
Assert.IsTrue(
path.StartsWith(fs.Path.GetTempPath(), StringComparison.Ordinal),
"File should be in temp path");
}

// Assert file is deleted
Assert.IsFalse(fs.File.Exists(path), "File should not exist");
Assert.That(fs.File.Exists(path), Is.False, "File should not exist");
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,24 @@

<PropertyGroup>
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="!$([MSBuild]::IsOsUnixLike())">$(TargetFrameworks);net462</TargetFrameworks>
<TargetFrameworks Condition="!$([MSBuild]::IsOsUnixLike())">$(TargetFrameworks);net472</TargetFrameworks>
<IsPackable>false</IsPackable>
<IsTestable>true</IsTestable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers" Version="21.3.1" />
<ProjectReference Include="..\..\src\System.IO.Abstractions.Extensions\System.IO.Abstractions.Extensions.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers" Version="22.0.10" />
<PackageReference Include="NUnit" Version="4.3.2" />
<PackageReference Include="NUnit.Analyzers" Version="4.3.0" />
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="coverlet.collector" Version="6.0.4" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1" />
<PackageReference Include="Snapshooter.NUnit" Version="1.0.1" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "2.2",
"version": "22.0",
"assemblyVersion": {
"precision": "major"
},
Expand Down
Loading