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
75
tests/Paca.Tests/Core/SmartPriorityQueueGateTests.cs
Normal file
75
tests/Paca.Tests/Core/SmartPriorityQueueGateTests.cs
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Paca.Mobile.Core;
|
||||
using Paca.Tests.Infrastructure;
|
||||
using Xunit;
|
||||
|
||||
namespace Paca.Tests.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Gate 203 ~ 206: 스마트 대기열 우선순위 큐 및 동적 동시성 할당 엔진 기계적 검증
|
||||
/// </summary>
|
||||
public class SmartPriorityQueueGateTests
|
||||
{
|
||||
[Fact]
|
||||
public void Gate203_SmartPriorityQueue_Orders_By_Priority_Then_Time()
|
||||
{
|
||||
var queue = new SmartPriorityQueueManager();
|
||||
|
||||
queue.Enqueue("job-1", "Normal Job 1", DownloadPriorityLevel.Normal, DateTimeOffset.UtcNow.AddMinutes(-5));
|
||||
queue.Enqueue("job-2", "Low Job", DownloadPriorityLevel.Low, DateTimeOffset.UtcNow.AddMinutes(-4));
|
||||
queue.Enqueue("job-3", "Urgent Job", DownloadPriorityLevel.Urgent, DateTimeOffset.UtcNow); // 가장 나중에 추가됨
|
||||
|
||||
var list = queue.GetScheduledJobs();
|
||||
|
||||
Assert.Equal("job-3", list[0].Id); // Urgent가 최상단
|
||||
Assert.Equal("job-1", list[1].Id); // Normal
|
||||
Assert.Equal("job-2", list[2].Id); // Low
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate204_SmartPriorityQueue_BumpToTop()
|
||||
{
|
||||
var queue = new SmartPriorityQueueManager();
|
||||
|
||||
queue.Enqueue("job-1", "Job 1", DownloadPriorityLevel.Normal);
|
||||
queue.Enqueue("job-2", "Job 2", DownloadPriorityLevel.Normal);
|
||||
queue.Enqueue("job-3", "Job 3", DownloadPriorityLevel.Normal);
|
||||
|
||||
// job-3을 맨 위로 올리기(Bump)
|
||||
var bumped = queue.BumpToTop("job-3");
|
||||
Assert.True(bumped);
|
||||
|
||||
var list = queue.GetScheduledJobs();
|
||||
Assert.Equal("job-3", list[0].Id);
|
||||
Assert.Equal(DownloadPriorityLevel.Urgent, list[0].Priority);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(NetworkProfileType.WiFi, 4)]
|
||||
[InlineData(NetworkProfileType.Cellular5G, 3)]
|
||||
[InlineData(NetworkProfileType.CellularLTE, 2)]
|
||||
[InlineData(NetworkProfileType.Cellular3G, 1)]
|
||||
public void Gate205_DynamicConcurrencyAllocator_Adjusts_By_Network(NetworkProfileType network, int expectedConcurrency)
|
||||
{
|
||||
var concurrency = DynamicConcurrencyAllocator.DetermineMaxConcurrentDownloads(network, isBatterySavingMode: false);
|
||||
Assert.Equal(expectedConcurrency, concurrency);
|
||||
|
||||
// 배터리 절약 모드 켜지면 무조건 1개로 제한
|
||||
var batterySavingConcurrency = DynamicConcurrencyAllocator.DetermineMaxConcurrentDownloads(network, isBatterySavingMode: true);
|
||||
Assert.Equal(1, batterySavingConcurrency);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate206_ServerHost_QueuePriority_Endpoint_Audit()
|
||||
{
|
||||
var serverHostPath = Path.Combine(SourceTree.Root, "src", "Paca.Server", "ServerHost.cs");
|
||||
Assert.True(File.Exists(serverHostPath), "ServerHost.cs must exist");
|
||||
|
||||
var code = File.ReadAllText(serverHostPath);
|
||||
|
||||
Assert.Contains("/api/queue/{id}/priority", code);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue