Skip to content

Commit

Permalink
[增加]1. 增加ActorID的单元测试
Browse files Browse the repository at this point in the history
  • Loading branch information
AlianBlank committed Jul 28, 2024
1 parent 78d28eb commit da2917e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Tests/GameFrameX.Tests/ActorIdGeneratorTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System.Text;
using GameFrameX.Core.Abstractions;
using GameFrameX.Core.Utility;

namespace GameFrameX.Tests;

public class ActorIdGeneratorTest
{
[SetUp]
public void Setup()
{
}

[Test]
public void compress()
{
var actorId = ActorIdGenerator.GetActorId(ActorType.World, 1000);

var type = ActorIdGenerator.GetActorType(actorId);
var serverId = ActorIdGenerator.GetServerId(actorId);

Assert.That(type == ActorType.World, Is.EqualTo(true));
Assert.That(serverId == 1000, Is.EqualTo(true));
}
}
1 change: 1 addition & 0 deletions Tests/GameFrameX.Tests/GameFrameX.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\GameFrameX.Core\GameFrameX.Core.csproj" />
<ProjectReference Include="..\..\GameFrameX.Utility\GameFrameX.Utility.csproj" />
</ItemGroup>

Expand Down

0 comments on commit da2917e

Please sign in to comment.