Initial commit
This commit is contained in:
commit
137cb2ce13
215 changed files with 659023 additions and 0 deletions
|
|
@ -0,0 +1,28 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
<RootNamespace>GameCult.Networking.Tests</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\GameCult.Networking\GameCult.Networking.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- NUnit framework -->
|
||||
<PackageReference Include="coverlet.msbuild" Version="6.0.4">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="NUnit" Version="4.*" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.*" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
|
||||
<PackageReference Include="FluentAssertions" Version="6.*" />
|
||||
<PackageReference Include="coverlet.collector" Version="6.*">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
18
tests/GameCult.Networking.Tests/NetworkingTests.cs
Normal file
18
tests/GameCult.Networking.Tests/NetworkingTests.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using System.Text;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace GameCult.Networking.Tests
|
||||
{
|
||||
public class NetworkingTests
|
||||
{
|
||||
[Test]
|
||||
public void EncryptDecrypt_Roundtrip()
|
||||
{
|
||||
var plaintext = Encoding.UTF8.GetBytes("test");
|
||||
var nonce = Secret.NewNonce;
|
||||
var encrypted = Secret.EncryptBytes(plaintext, nonce);
|
||||
var decrypted = Secret.DecryptBytes(encrypted, nonce);
|
||||
Assert.That(plaintext, Is.EqualTo(decrypted));
|
||||
}
|
||||
}
|
||||
}
|
||||
2537
tests/GameCult.Networking.Tests/lcov.info
Normal file
2537
tests/GameCult.Networking.Tests/lcov.info
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue