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
55
tests/Paca.Tests/Core/AdaptiveBufferScalerGateTests.cs
Normal file
55
tests/Paca.Tests/Core/AdaptiveBufferScalerGateTests.cs
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
using System;
|
||||
using Paca.Mobile.Core;
|
||||
using Xunit;
|
||||
|
||||
namespace Paca.Tests.Core;
|
||||
|
||||
public class AdaptiveBufferScalerGateTests
|
||||
{
|
||||
[Fact]
|
||||
public void Gate393_AdaptiveBufferScaler_SelectsGigabitUltra_ForHighThroughput()
|
||||
{
|
||||
// 80 MB/s
|
||||
var speed = 80.0 * 1024 * 1024;
|
||||
var profile = AdaptiveBufferScaler.GetAdaptationProfile(speed);
|
||||
|
||||
Assert.Equal(BufferScalingTier.GigabitUltra, profile.CurrentTier);
|
||||
Assert.Equal(512 * 1024, profile.BufferSizeBytes);
|
||||
Assert.Equal(20 * 1024 * 1024L, profile.RecommendedChunkSizeBytes);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate394_AdaptiveBufferScaler_SelectsMedium_ForModerateSpeed()
|
||||
{
|
||||
// 5 MB/s
|
||||
var speed = 5.0 * 1024 * 1024;
|
||||
var profile = AdaptiveBufferScaler.GetAdaptationProfile(speed);
|
||||
|
||||
Assert.Equal(BufferScalingTier.MediumBandwidth, profile.CurrentTier);
|
||||
Assert.Equal(32 * 1024, profile.BufferSizeBytes);
|
||||
Assert.Equal(5 * 1024 * 1024L, profile.RecommendedChunkSizeBytes);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate395_AdaptiveBufferScaler_SelectsLow_ForSlowConnections()
|
||||
{
|
||||
// 500 KB/s
|
||||
var speed = 500.0 * 1024;
|
||||
var profile = AdaptiveBufferScaler.GetAdaptationProfile(speed);
|
||||
|
||||
Assert.Equal(BufferScalingTier.LowBandwidth, profile.CurrentTier);
|
||||
Assert.Equal(8 * 1024, profile.BufferSizeBytes);
|
||||
Assert.Equal(1 * 1024 * 1024L, profile.RecommendedChunkSizeBytes);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate396_AdaptiveBufferScaler_SmoothsSpeed_WithExponentialMovingAverage()
|
||||
{
|
||||
var prevAvg = 10.0;
|
||||
var newSample = 20.0;
|
||||
// With alpha 0.3: 0.3 * 20 + 0.7 * 10 = 6 + 7 = 13.0
|
||||
var smoothed = AdaptiveBufferScaler.SmoothSpeedEma(prevAvg, newSample, alpha: 0.3);
|
||||
|
||||
Assert.Equal(13.0, smoothed, 2);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue