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
56
tests/Paca.Tests/App/GlobalHotkeyGateTests.cs
Normal file
56
tests/Paca.Tests/App/GlobalHotkeyGateTests.cs
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
using System;
|
||||
using System.Windows.Input;
|
||||
using Paca.App.Core;
|
||||
using Xunit;
|
||||
|
||||
namespace Paca.Tests.App;
|
||||
|
||||
public class GlobalHotkeyGateTests
|
||||
{
|
||||
[Fact]
|
||||
public void Gate257_GlobalHotkeyParser_ParsesKeyModifiers()
|
||||
{
|
||||
var success = GlobalHotkeyParser.TryParse("Ctrl+Shift+D", out var modifiers, out var key);
|
||||
|
||||
Assert.True(success);
|
||||
Assert.Equal(ModifierKeys.Control | ModifierKeys.Shift, modifiers);
|
||||
Assert.Equal(Key.D, key);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate258_GlobalHotkeyParser_ParsesAlternativeShortcut()
|
||||
{
|
||||
var success = GlobalHotkeyParser.TryParse("Ctrl+Alt+V", out var modifiers, out var key);
|
||||
|
||||
Assert.True(success);
|
||||
Assert.Equal(ModifierKeys.Control | ModifierKeys.Alt, modifiers);
|
||||
Assert.Equal(Key.V, key);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate259_GlobalHotkeyManager_CalculatesWin32ModFlags()
|
||||
{
|
||||
var modFlags = GlobalHotkeyManager.GetWin32ModifierFlags(ModifierKeys.Control | ModifierKeys.Shift);
|
||||
|
||||
// MOD_CONTROL = 0x0002, MOD_SHIFT = 0x0004 -> 0x0006
|
||||
Assert.Equal(0x0006u, modFlags);
|
||||
|
||||
var altWin = GlobalHotkeyManager.GetWin32ModifierFlags(ModifierKeys.Alt | ModifierKeys.Windows);
|
||||
// MOD_ALT = 0x0001, MOD_WIN = 0x0008 -> 0x0009
|
||||
Assert.Equal(0x0009u, altWin);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gate260_GlobalHotkeyManager_HotkeyTrigger_InvokesCallback()
|
||||
{
|
||||
var manager = new GlobalHotkeyManager();
|
||||
bool triggered = false;
|
||||
|
||||
manager.RegisterVirtualHotkey("Ctrl+Shift+D", () => triggered = true);
|
||||
|
||||
// Simulate trigger
|
||||
manager.SimulateHotkeyTrigger("Ctrl+Shift+D");
|
||||
|
||||
Assert.True(triggered);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue