Add log parser to output added file list sorted by size
This commit is contained in:
18
ResticLogParserTests/FileSizeTests.cs
Normal file
18
ResticLogParserTests/FileSizeTests.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using ResticLogParser.src;
|
||||
|
||||
namespace ResticLogParserTests
|
||||
{
|
||||
public class FileSizeTests
|
||||
{
|
||||
[TestCase("0 B", 0)]
|
||||
[TestCase("739 B", 739)]
|
||||
[TestCase("17.601 KiB", 18023)]
|
||||
[TestCase("17.601 KB", 17601)]
|
||||
[TestCase("107.135 MiB", 112339190)]
|
||||
[TestCase("107.135 MB", 107135000)]
|
||||
public void Test(string fileSizeText, long expected)
|
||||
{
|
||||
Assert.That(FileSize.GetBytesFromString(fileSizeText), Is.EqualTo(expected));
|
||||
}
|
||||
}
|
||||
}
|
||||
28
ResticLogParserTests/ResticLogParserTests.csproj
Normal file
28
ResticLogParserTests/ResticLogParserTests.csproj
Normal file
@@ -0,0 +1,28 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
|
||||
<PackageReference Include="NUnit" Version="3.14.0" />
|
||||
<PackageReference Include="NUnit.Analyzers" Version="3.9.0" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ResticLogParser\ResticLogParser.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Using Include="NUnit.Framework" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user