Esempio n. 1
0
        public static void ShouldBeKeyUpFor(this EventArgsWithName <RemoteKeyTracker> eventArgsWithName, WirelessNetworkAddress source, RemoteKey key)
        {
            Guard.NotNull(eventArgsWithName, nameof(eventArgsWithName));
            Guard.NotNull(source, nameof(source));

            eventArgsWithName.Name.Should().Be("KeyUp");
            eventArgsWithName.EventArgs.Should().BeOfType <RemoteKeyEventArgs>();

            var remoteKeyModifierEventArgs = (RemoteKeyEventArgs)eventArgsWithName.EventArgs;

            remoteKeyModifierEventArgs.Source.Should().Be(source);
            remoteKeyModifierEventArgs.Key.Should().Be(key);
        }
Esempio n. 2
0
        public static void ShouldBeMissingKeyFor(this EventArgsWithName <RemoteKeyTracker> eventArgsWithName, WirelessNetworkAddress source,
                                                 TimeSpan?sensorTime)
        {
            Guard.NotNull(eventArgsWithName, nameof(eventArgsWithName));
            Guard.NotNull(source, nameof(source));

            eventArgsWithName.Name.Should().Be("MissingKey");
            eventArgsWithName.EventArgs.Should().BeOfType <DeviceTimeEventArgs>();

            var deviceTimeEventArgs = (DeviceTimeEventArgs)eventArgsWithName.EventArgs;

            deviceTimeEventArgs.Source.Should().Be(source);
            deviceTimeEventArgs.SensorTime.Should().Be(sensorTime);
        }
Esempio n. 3
0
        public static void ShouldBeModifierKeyDownFor(this EventArgsWithName <RemoteKeyTracker> eventArgsWithName, WirelessNetworkAddress source,
                                                      RemoteKeyModifier modifier)
        {
            Guard.NotNull(eventArgsWithName, nameof(eventArgsWithName));
            Guard.NotNull(source, nameof(source));

            eventArgsWithName.Name.Should().Be("ModifierKeyDown");
            eventArgsWithName.EventArgs.Should().BeOfType <RemoteKeyModifierEventArgs>();

            var remoteKeyModifierEventArgs = (RemoteKeyModifierEventArgs)eventArgsWithName.EventArgs;

            remoteKeyModifierEventArgs.Source.Should().Be(source);
            remoteKeyModifierEventArgs.Modifier.Should().Be(modifier);
        }