blob: ccdcaef44bcd098112f8cd8f8be3bb7fd2ac22ba (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 | #import "MASShortcutMonitor.h"
@interface MASShortcutMonitorTests : XCTestCase
@end
@implementation MASShortcutMonitorTests
- (void) testMonitorCreation
{
    XCTAssertNotNil([MASShortcutMonitor sharedMonitor], @"Create a shared shortcut monitor.");
}
- (void) testShortcutRegistration
{
    MASShortcutMonitor *monitor = [MASShortcutMonitor sharedMonitor];
    MASShortcut *shortcut = [MASShortcut shortcutWithKeyCode:kVK_ANSI_H modifierFlags:NSCommandKeyMask|NSAlternateKeyMask];
    XCTAssertTrue([monitor registerShortcut:shortcut withAction:NULL], @"Register a shortcut.");
    XCTAssertTrue([monitor isShortcutRegistered:shortcut], @"Remember a previously registered shortcut.");
    [monitor unregisterShortcut:shortcut];
    XCTAssertFalse([monitor isShortcutRegistered:shortcut], @"Forget shortcut after unregistering.");
}
@end
 |