Skip to content

Commit

Permalink
Dependabot/nuget/nunit 4.0.1 (#77)
Browse files Browse the repository at this point in the history
* Bump nunit from 3.13.3 to 4.0.1

Bumps [nunit](https://github.com/nunit/nunit) from 3.13.3 to 4.0.1.
- [Release notes](https://github.com/nunit/nunit/releases)
- [Changelog](https://github.com/nunit/nunit/blob/master/CHANGES.md)
- [Commits](nunit/nunit@v3.13.3...v4.0.1)

---
updated-dependencies:
- dependency-name: nunit
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* some nunit 4 adjustments

* adjuist asserts for nunit 4

* update dependencies

* update dependencies

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
KircMax and dependabot[bot] authored Oct 21, 2024
1 parent 8871e87 commit 48a480f
Show file tree
Hide file tree
Showing 5 changed files with 173 additions and 162 deletions.
3 changes: 2 additions & 1 deletion src/Webserver.API/Webserver.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<PackageIcon>product-simatic-s7-1500-256-256.png</PackageIcon>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<IsTestProject>false</IsTestProject>
</PropertyGroup>

<ItemGroup>
Expand All @@ -35,7 +36,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Update="Nerdbank.GitVersioning" Version="3.6.133" />
<PackageReference Update="Nerdbank.GitVersioning" Version="3.6.146" />
</ItemGroup>

</Project>
84 changes: 42 additions & 42 deletions tests/Webserver.API.UnitTests/ApiDirectoryBuilderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ public void T004_EmptyDirectory_Built()
var builder = new ApiDirectoryBuilder(localTmpDirectory, new ApiFileResourceBuilder(), false);
var parseConfig = new ApiDirectoryBuilderConfiguration() { };
var res = builder.Build(parseConfig);
Assert.AreEqual(localTmpDirectory, res.PathToLocalDirectory);
Assert.AreEqual(0, res.Resources.Count);
Assert.AreEqual(ApiFileResourceState.Active, res.State);
Assert.That(res.PathToLocalDirectory, Is.EqualTo(localTmpDirectory));
Assert.That(res.Resources.Count, Is.EqualTo(0));
Assert.That(res.State, Is.EqualTo(ApiFileResourceState.Active));
var dirInf = new DirectoryInfo(localTmpDirectory);
Assert.AreEqual(dirInf.LastWriteTime, res.Last_Modified);
Assert.AreEqual(dirInf.Name, res.Name);
Assert.IsNull(res.Size);
Assert.That(res.Last_Modified, Is.EqualTo(dirInf.LastWriteTime));
Assert.That(res.Name, Is.EqualTo(dirInf.Name));
Assert.That(res.Size, Is.Null);
}
finally
{
Expand All @@ -104,15 +104,15 @@ public void T005_DirectoryWithFile_Built()
var builder = new ApiDirectoryBuilder(localTmpDirectory, new ApiFileResourceBuilder(), false);
var parseConfig = new ApiDirectoryBuilderConfiguration() { };
var res = builder.Build(parseConfig);
Assert.AreEqual(1, res.Resources.Count);
Assert.IsNull(res.Size);
Assert.That(res.Resources.Count, Is.EqualTo(1));
Assert.That(res.Size, Is.Null);
var firstRes = res.Resources.First();
Assert.AreEqual(ApiFileResourceType.File, firstRes.Type);
Assert.AreEqual(ApiFileResourceState.Active, firstRes.State);
Assert.That(firstRes.Type, Is.EqualTo(ApiFileResourceType.File));
Assert.That(firstRes.State, Is.EqualTo(ApiFileResourceState.Active));
var fileInfo = new FileInfo(filePath);
Assert.AreEqual(fileInfo.Length, firstRes.Size);
Assert.AreEqual(fileInfo.LastWriteTime, firstRes.Last_Modified);
Assert.AreEqual(localTmpDirectory, firstRes.PathToLocalDirectory);
Assert.That(firstRes.Size, Is.EqualTo(fileInfo.Length));
Assert.That(firstRes.Last_Modified, Is.EqualTo(fileInfo.LastWriteTime));
Assert.That(firstRes.PathToLocalDirectory, Is.EqualTo(localTmpDirectory));
}
finally
{
Expand All @@ -132,14 +132,14 @@ public void T006_DirectoryWithDir_Built()
var builder = new ApiDirectoryBuilder(localTmpDirectory, new ApiFileResourceBuilder(), false);
var parseConfig = new ApiDirectoryBuilderConfiguration() { };
var res = builder.Build(parseConfig);
Assert.AreEqual(1, res.Resources.Count);
Assert.IsNull(res.Size);
Assert.That(res.Resources.Count, Is.EqualTo(1));
Assert.That(res.Size, Is.Null);
var firstRes = res.Resources.First();
Assert.AreEqual(ApiFileResourceType.Dir, firstRes.Type);
Assert.AreEqual(ApiFileResourceState.Active, firstRes.State);
Assert.IsNull(firstRes.Size);
Assert.AreEqual(dirInfo.LastWriteTime, firstRes.Last_Modified);
Assert.AreEqual(dirPath, firstRes.PathToLocalDirectory);
Assert.That(firstRes.Type, Is.EqualTo(ApiFileResourceType.Dir));
Assert.That(firstRes.State, Is.EqualTo(ApiFileResourceState.Active));
Assert.That(firstRes.Size, Is.Null);
Assert.That(firstRes.Last_Modified, Is.EqualTo(dirInfo.LastWriteTime));
Assert.That(firstRes.PathToLocalDirectory, Is.EqualTo(dirPath));
}
finally
{
Expand Down Expand Up @@ -186,38 +186,38 @@ public void T007_DirectoryWithDirAndFiles_Built()
var builder = new ApiDirectoryBuilder(localTmpDirectory, new ApiFileResourceBuilder(), false);
var parseConfig = new ApiDirectoryBuilderConfiguration() { };
var res = builder.Build(parseConfig);
Assert.AreEqual(2, res.Resources.Count);
Assert.That(res.Resources.Count, Is.EqualTo(2));
var dirRes = res.Resources.First(el => el.Type == ApiFileResourceType.Dir);
var fileRes = res.Resources.First(el => el.Type == ApiFileResourceType.File);
Assert.AreEqual(dirInfo2.Name, dirRes.Name);
Assert.AreEqual(2, dirRes.Resources.Count);
Assert.AreEqual(1, dirRes.Parents.Count);
Assert.AreEqual(dirInfo2.FullName, dirRes.PathToLocalDirectory);
Assert.That(dirRes.Name, Is.EqualTo(dirInfo2.Name));
Assert.That(dirRes.Resources.Count, Is.EqualTo(2));
Assert.That(dirRes.Parents.Count, Is.EqualTo(1));
Assert.That(dirRes.PathToLocalDirectory, Is.EqualTo(dirInfo2.FullName));

Assert.AreEqual(fileInfo.Name, fileRes.Name);
Assert.AreEqual(filePath, Path.Combine(fileRes.PathToLocalDirectory, fileRes.Name));
Assert.AreEqual(1, fileRes.Parents.Count);
Assert.AreEqual(0, fileRes.Resources.Count);
Assert.That(fileRes.Name, Is.EqualTo(fileInfo.Name));
Assert.That(Path.Combine(fileRes.PathToLocalDirectory, fileRes.Name), Is.EqualTo(filePath));
Assert.That(fileRes.Parents.Count, Is.EqualTo(1));
Assert.That(fileRes.Resources.Count, Is.EqualTo(0));

var subRes = dirRes.Resources;
Assert.AreEqual(2, subRes.Count);
Assert.That(subRes.Count, Is.EqualTo(2));
var dirRes2 = subRes.First(el => el.Type == ApiFileResourceType.Dir);
var fileRes2 = subRes.First(el => el.Type == ApiFileResourceType.File);
Assert.AreEqual(dirInfo3.Name, dirRes2.Name);
Assert.AreEqual(1, dirRes2.Resources.Count);
Assert.AreEqual(2, dirRes2.Parents.Count);
Assert.AreEqual(dirPath3, dirRes2.PathToLocalDirectory);
Assert.That(dirRes2.Name, Is.EqualTo(dirInfo3.Name));
Assert.That(dirRes2.Resources.Count, Is.EqualTo(1));
Assert.That(dirRes2.Parents.Count, Is.EqualTo(2));
Assert.That(dirRes2.PathToLocalDirectory, Is.EqualTo(dirPath3));

Assert.AreEqual(fileInfo2.Name, fileRes2.Name);
Assert.AreEqual(filePath2, Path.Combine(fileRes2.PathToLocalDirectory, fileRes2.Name));
Assert.AreEqual(2, fileRes2.Parents.Count);
Assert.AreEqual(0, fileRes2.Resources.Count);
Assert.That(fileRes2.Name, Is.EqualTo(fileInfo2.Name));
Assert.That(Path.Combine(fileRes2.PathToLocalDirectory, fileRes2.Name), Is.EqualTo(filePath2));
Assert.That(fileRes2.Parents.Count, Is.EqualTo(2));
Assert.That(fileRes2.Resources.Count, Is.EqualTo(0));

var fileRes3 = dirRes2.Resources.First();
Assert.AreEqual(fileInfo3.Name, fileRes3.Name);
Assert.AreEqual(filePath3, Path.Combine(fileRes3.PathToLocalDirectory, fileRes3.Name));
Assert.AreEqual(0, fileRes3.Resources.Count);
Assert.AreEqual(3, fileRes3.Parents.Count);
Assert.That(fileRes3.Name, Is.EqualTo(fileInfo3.Name));
Assert.That(Path.Combine(fileRes3.PathToLocalDirectory, fileRes3.Name), Is.EqualTo(filePath3));
Assert.That(fileRes3.Resources.Count, Is.EqualTo(0));
Assert.That(fileRes3.Parents.Count, Is.EqualTo(3));
}
finally
{
Expand Down
Loading

0 comments on commit 48a480f

Please sign in to comment.