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/Mobile/MobileQrPairingUiGateTests.cs
Normal file
55
tests/Paca.Tests/Mobile/MobileQrPairingUiGateTests.cs
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
using System.IO;
|
||||
using Paca.Mobile.Core;
|
||||
using Xunit;
|
||||
|
||||
namespace Paca.Tests.Mobile;
|
||||
|
||||
public class MobileQrPairingUiGateTests
|
||||
{
|
||||
private static readonly string SolutionRoot = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", ".."));
|
||||
|
||||
[Fact]
|
||||
public void Gate_QrPayloadCodec_Roundtrip_EnsuresIntegrity()
|
||||
{
|
||||
var original = new P2pQrPayload
|
||||
{
|
||||
Host = "192.168.1.100",
|
||||
Port = 52100,
|
||||
Token = "secret-token-xyz-12345",
|
||||
DeviceName = "MyDesktop-PC",
|
||||
Fingerprint = "fp-abc"
|
||||
};
|
||||
|
||||
var encoded = P2pQrPayloadCodec.Encode(original);
|
||||
Assert.NotNull(encoded);
|
||||
Assert.StartsWith("paca://pair?", encoded);
|
||||
|
||||
var decoded = P2pQrPayloadCodec.Decode(encoded);
|
||||
Assert.NotNull(decoded);
|
||||
Assert.Equal(original.Host, decoded.Host);
|
||||
Assert.Equal(original.Port, decoded.Port);
|
||||
Assert.Equal(original.Token, decoded.Token);
|
||||
Assert.Equal(original.DeviceName, decoded.DeviceName);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate_QrPayloadCodec_RejectsCorruptOrInvalidQr()
|
||||
{
|
||||
Assert.Throws<ArgumentException>(() => P2pQrPayloadCodec.Decode(""));
|
||||
Assert.Throws<ArgumentException>(() => P2pQrPayloadCodec.Decode("INVALID_QR_FORMAT"));
|
||||
Assert.Throws<InvalidOperationException>(() => P2pQrPayloadCodec.Decode("paca://pair?h=127.0.0.1&p=5000&t=tok&sig=wrong"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate_SyncSettingsPage_Contains_QrScanButton_And_CodecWiring()
|
||||
{
|
||||
var syncPagePath = Path.Combine(SolutionRoot, "src", "Paca.Mobile", "SyncSettingsPage.cs");
|
||||
Assert.True(File.Exists(syncPagePath), $"SyncSettingsPage.cs not found at {syncPagePath}");
|
||||
|
||||
var code = File.ReadAllText(syncPagePath);
|
||||
Assert.True(code.Contains("P2pQrPayloadCodec.Decode") || code.Contains("P2pQrPayloadCodec"),
|
||||
"SyncSettingsPage.cs must wire P2pQrPayloadCodec to decode QR scan results");
|
||||
Assert.True(code.Contains("QR") || code.Contains("Qr"),
|
||||
"SyncSettingsPage.cs must provide a QR Scan pairing interaction element");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue