feat(ads/seo/release): v1.2.0 with live Google Ads, isolated ad profile, ads.txt, and SEO/AEO/GEO optimization
This commit is contained in:
parent
a88aafa1e5
commit
0e568f1f0a
975 changed files with 130593 additions and 16783 deletions
58
tests/Paca.Tests/Server/ServerLanBeaconGateTests.cs
Normal file
58
tests/Paca.Tests/Server/ServerLanBeaconGateTests.cs
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
using System.Net.Sockets;
|
||||
using System.Threading.Tasks;
|
||||
using Paca.Core.Config;
|
||||
using Paca.Mobile.Core;
|
||||
using Paca.Server;
|
||||
using Xunit;
|
||||
|
||||
namespace Paca.Tests.Server;
|
||||
|
||||
public class ServerLanBeaconGateTests
|
||||
{
|
||||
[Fact]
|
||||
public void Gate238_AppConfig_RemoteAccessPort_Default_52100_Audit()
|
||||
{
|
||||
var config = new AppConfig();
|
||||
Assert.Equal(52100, config.RemoteAccessPort);
|
||||
|
||||
var opts = new ServerOptions();
|
||||
Assert.True(opts.EnableLanBeacon);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Gate237_ServerHost_Starts_And_Stops_LanBeaconResponder_Correctly()
|
||||
{
|
||||
// 고유 UDP 포트를 사용하여 병렬 테스트 충돌 방지
|
||||
int testUdpPort = 52199;
|
||||
var options = new ServerOptions
|
||||
{
|
||||
Port = 0,
|
||||
Token = "test_token_1234",
|
||||
EnableLanBeacon = true,
|
||||
BeaconPort = testUdpPort,
|
||||
DeviceName = "TestHostPC"
|
||||
};
|
||||
|
||||
await using var host = await ServerHost.StartAsync(options);
|
||||
Assert.True(host.LanBeaconActive);
|
||||
|
||||
// UdpClient로 Ping을 보내고 Pong 응답 확인
|
||||
using var client = new UdpClient();
|
||||
var ping = LanDiscoveryMessage.CreatePing("TestMobileClient");
|
||||
var pingBytes = System.Text.Encoding.UTF8.GetBytes(ping.ToPayload());
|
||||
await client.SendAsync(pingBytes, pingBytes.Length, "127.0.0.1", testUdpPort);
|
||||
|
||||
var receiveTask = client.ReceiveAsync();
|
||||
var completed = await Task.WhenAny(receiveTask, Task.Delay(2000));
|
||||
Assert.Same(receiveTask, completed);
|
||||
|
||||
var response = await receiveTask;
|
||||
var responseText = System.Text.Encoding.UTF8.GetString(response.Buffer);
|
||||
var parsed = LanDiscoveryMessage.Parse(responseText);
|
||||
|
||||
Assert.NotNull(parsed);
|
||||
Assert.Equal(LanDiscoveryMessageType.Pong, parsed.Type);
|
||||
Assert.Equal("TestHostPC", parsed.DeviceName);
|
||||
Assert.EndsWith($":{host.Port}", parsed.Endpoint);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue