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
71
tests/Paca.Tests/App/MultiDisplayLayoutEngineGateTests.cs
Normal file
71
tests/Paca.Tests/App/MultiDisplayLayoutEngineGateTests.cs
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
using Paca.App.Core;
|
||||
using Xunit;
|
||||
|
||||
namespace Paca.Tests.App;
|
||||
|
||||
public class MultiDisplayLayoutEngineGateTests
|
||||
{
|
||||
[Fact]
|
||||
public void Gate269_MultiDisplayLayoutEngine_ClampsWindow_WithinSingleMonitorBounds()
|
||||
{
|
||||
var workArea = new Rect(0, 0, 1920, 1080);
|
||||
// Window 400x300 requested at (1800, 950) -> exceeds 1920 and 1080
|
||||
var clamped = MultiDisplayLayoutEngine.ClampToWorkArea(
|
||||
requestedLeft: 1800,
|
||||
requestedTop: 950,
|
||||
windowWidth: 400,
|
||||
windowHeight: 300,
|
||||
workArea: workArea,
|
||||
margin: 16
|
||||
);
|
||||
|
||||
Assert.Equal(1920 - 400 - 16, clamped.X);
|
||||
Assert.Equal(1080 - 300 - 16, clamped.Y);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate270_MultiDisplayLayoutEngine_HandlesNegativeCoordinates_OnSecondaryLeftMonitor()
|
||||
{
|
||||
var leftMonitorWorkArea = new Rect(-1920, 0, 1920, 1080);
|
||||
|
||||
// Window 400x300 requested at -2000 (beyond left edge)
|
||||
var clamped = MultiDisplayLayoutEngine.ClampToWorkArea(
|
||||
requestedLeft: -2000,
|
||||
requestedTop: 100,
|
||||
windowWidth: 400,
|
||||
windowHeight: 300,
|
||||
workArea: leftMonitorWorkArea,
|
||||
margin: 16
|
||||
);
|
||||
|
||||
Assert.Equal(-1920 + 16, clamped.X);
|
||||
Assert.Equal(100, clamped.Y);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate271_MultiDisplayLayoutEngine_ConvertsDpiToDips()
|
||||
{
|
||||
// Standard 96 DPI = 1.0 scale
|
||||
Assert.Equal(100.0, MultiDisplayLayoutEngine.PixelsToDips(100, 96));
|
||||
|
||||
// 144 DPI (150% scaling) -> 150 pixels = 100 DIPs
|
||||
Assert.Equal(100.0, MultiDisplayLayoutEngine.PixelsToDips(150, 144));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate272_MultiDisplayLayoutEngine_FindsBestScreen_ForWindow()
|
||||
{
|
||||
var screens = new List<Rect>
|
||||
{
|
||||
new(0, 0, 1920, 1080), // Primary screen
|
||||
new(1920, 0, 1920, 1080) // Secondary screen to the right
|
||||
};
|
||||
|
||||
// Window placed mostly on secondary screen (e.g. x=2000)
|
||||
var bestScreen = MultiDisplayLayoutEngine.FindBestScreen(new Rect(2000, 200, 400, 300), screens);
|
||||
Assert.Equal(1920, bestScreen.X);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue