Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependabot/nuget/nunit 4.0.1 #77

Merged
merged 6 commits into from
Oct 21, 2024
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
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