- Introduced Telegram.Bot package for bot functionality. - Updated user management to include Telegram linking and blocking features. - Enhanced activation request handling with notifications via Telegram. - Added new database entities for Telegram link tokens and login requests. - Implemented traffic synchronization for client stats in the XuiPanelGateway. - Updated application structure to support new test projects and improved dependency injection for Telegram services.
35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
using PnvPanel.Domain.Apps;
|
|
using Xunit;
|
|
|
|
namespace PnvPanel.Domain.Tests.Apps;
|
|
|
|
public class ClientAppTests
|
|
{
|
|
[Fact]
|
|
public void Create_SetsEnabledByDefault()
|
|
{
|
|
var app = ClientApp.Create("v2rayNG", new Uri("https://play.google.com/store/apps/details?id=x"), OsPlatform.Android, "desc", null, 1);
|
|
|
|
Assert.Equal("v2rayNG", app.Name);
|
|
Assert.Equal(OsPlatform.Android, app.OperatingSystem);
|
|
Assert.True(app.IsEnabled);
|
|
Assert.Equal(1, app.SortOrder);
|
|
}
|
|
|
|
[Fact]
|
|
public void Update_ReplacesAllMutableFields()
|
|
{
|
|
var app = ClientApp.Create("Old", new Uri("https://old.example.com"), OsPlatform.IOS, "old", "old-icon", 1);
|
|
|
|
app.Update("New", new Uri("https://new.example.com"), OsPlatform.MacOS, "new", "new-icon", 2, isEnabled: false);
|
|
|
|
Assert.Equal("New", app.Name);
|
|
Assert.Equal(new Uri("https://new.example.com"), app.DownloadUrl);
|
|
Assert.Equal(OsPlatform.MacOS, app.OperatingSystem);
|
|
Assert.Equal("new", app.Description);
|
|
Assert.Equal("new-icon", app.IconUrl);
|
|
Assert.Equal(2, app.SortOrder);
|
|
Assert.False(app.IsEnabled);
|
|
}
|
|
}
|