public static bool?TestAreModifiersPressed([NotNull] Hotkey hotkey) { if (hotkey.InputDevices == null) { Assert.Throws <InvalidOperationException>(() => hotkey.AreModifiersPressed()); return(null); } return(hotkey.AreModifiersPressed()); }