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
86
tests/Paca.Tests/Core/PacaDeepLinkGateTests.cs
Normal file
86
tests/Paca.Tests/Core/PacaDeepLinkGateTests.cs
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
using System;
|
||||
using Paca.Mobile.Core;
|
||||
using Xunit;
|
||||
|
||||
namespace Paca.Tests.Core;
|
||||
|
||||
public class PacaDeepLinkGateTests
|
||||
{
|
||||
[Fact]
|
||||
public void Gate215_PacaDeepLinkParser_ParsesDownloadAction_WithValidParameters()
|
||||
{
|
||||
// Arrange
|
||||
var uri = "paca://download?url=https%3A%2F%2Fexample.com%2Fvideo%2F123&format=mp4&quality=1080p";
|
||||
|
||||
// Act
|
||||
var success = PacaDeepLinkParser.TryParse(uri, out var action);
|
||||
|
||||
// Assert
|
||||
Assert.True(success);
|
||||
Assert.NotNull(action);
|
||||
Assert.Equal(PacaDeepLinkActionType.Download, action!.ActionType);
|
||||
|
||||
var downloadAction = Assert.IsType<PacaDownloadDeepLinkAction>(action);
|
||||
Assert.Equal("https://example.com/video/123", downloadAction.TargetUrl);
|
||||
Assert.Equal("mp4", downloadAction.Format);
|
||||
Assert.Equal("1080p", downloadAction.Quality);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate216_PacaDeepLinkParser_ParsesPairingAction_WithConnectCode()
|
||||
{
|
||||
// Arrange
|
||||
var uri = "paca://pair?code=PACA-982341&host=192.168.1.100&port=5000";
|
||||
|
||||
// Act
|
||||
var success = PacaDeepLinkParser.TryParse(uri, out var action);
|
||||
|
||||
// Assert
|
||||
Assert.True(success);
|
||||
Assert.NotNull(action);
|
||||
Assert.Equal(PacaDeepLinkActionType.Pair, action!.ActionType);
|
||||
|
||||
var pairAction = Assert.IsType<PacaPairDeepLinkAction>(action);
|
||||
Assert.Equal("PACA-982341", pairAction.ConnectCode);
|
||||
Assert.Equal("192.168.1.100", pairAction.Host);
|
||||
Assert.Equal(5000, pairAction.Port);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate217_PacaDeepLinkParser_ParsesPlaybackAction_WithSeekTime()
|
||||
{
|
||||
// Arrange
|
||||
var uri = "paca://play?id=media-abc-123&t=145";
|
||||
|
||||
// Act
|
||||
var success = PacaDeepLinkParser.TryParse(uri, out var action);
|
||||
|
||||
// Assert
|
||||
Assert.True(success);
|
||||
Assert.NotNull(action);
|
||||
Assert.Equal(PacaDeepLinkActionType.Play, action!.ActionType);
|
||||
|
||||
var playAction = Assert.IsType<PacaPlayDeepLinkAction>(action);
|
||||
Assert.Equal("media-abc-123", playAction.MediaId);
|
||||
Assert.Equal(145, playAction.SeekSeconds);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate218_PacaDeepLinkParser_RejectsMaliciousOrInvalidSchemes()
|
||||
{
|
||||
// 1. Invalid scheme
|
||||
Assert.False(PacaDeepLinkParser.TryParse("https://example.com/download", out _));
|
||||
Assert.False(PacaDeepLinkParser.TryParse("javascript:alert(1)", out _));
|
||||
|
||||
// 2. Local file exploit attempt inside download URL
|
||||
Assert.False(PacaDeepLinkParser.TryParse("paca://download?url=file%3A%2F%2F%2FC%3A%2Fsecret.txt", out _));
|
||||
|
||||
// 3. Unknown or dangerous action
|
||||
Assert.False(PacaDeepLinkParser.TryParse("paca://system?cmd=shutdown", out _));
|
||||
Assert.False(PacaDeepLinkParser.TryParse("paca://invalid_action", out _));
|
||||
|
||||
// 4. Null or empty
|
||||
Assert.False(PacaDeepLinkParser.TryParse("", out _));
|
||||
Assert.False(PacaDeepLinkParser.TryParse(null!, out _));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue