节点在线、应用在线、配置在线使用令牌查询
大石头 authored at 2021-12-16 19:49:30
784.00 B
Stardust
using Stardust.Data.Platform;
using Xunit;

namespace ServerTest.Platform;

/// <summary>星系项目管理单元测试</summary>
public class GalaxyProjectTests
{
    [Fact]
    public void InsertAndFindById()
    {
        var entity = new GalaxyProject
        {
            Name = "test-project-" + Guid.NewGuid().ToString("n")[..8],
            Enable = true,
        };

        try
        {
            var count = entity.Insert();
            Assert.True(count > 0);
            Assert.True(entity.Id > 0);

            var found = GalaxyProject.FindById(entity.Id);
            Assert.NotNull(found);
            Assert.Equal(entity.Name, found.Name);
            Assert.True(found.Enable);
        }
        finally
        {
            entity.Delete();
        }
    }
}