Ejemplo n.º 1
0
        public static bool TestCanPerformAction([NotNull] FakeHotkey hotkey, Action <FakeHotkey> setup, Action <FakeHotkey> tearDown)
        {
            setup?.Invoke(hotkey);
            bool canPerformAction = hotkey.CanPerformAction;

            tearDown?.Invoke(hotkey);
            return(canPerformAction);
        }
Ejemplo n.º 2
0
        public static bool TestActiveAndInit([NotNull] FakeHotkey hotkey, Action <FakeHotkey> setup, Action <FakeHotkey> tearDown)
        {
            setup?.Invoke(hotkey);
            bool initialized = hotkey.Initialized;

            tearDown?.Invoke(hotkey);
            return(initialized);
        }
Ejemplo n.º 3
0
        public void WriteJsonTest()
        {
            Hotkey hotkey = new FakeHotkey();

            Assert.That(() =>
            {
                using (var writer = new StringWriter())
                {
                    using (var jsonWriter = new JsonTextWriter(writer))
                    {
                        this.hotkeyJsonConverter.WriteJson(jsonWriter, hotkey, this.serializer);
                    }
                }
            }, Throws.TypeOf <NotImplementedException>());
        }
Ejemplo n.º 4
0
 public void TearDown()
 {
     this.fakeHotkey.Dispose();
     this.fakeHotkey = null;
 }
Ejemplo n.º 5
0
 public void SetUp()
 {
     this.fakeHotkey = new FakeHotkey(this.action);
     this.fakeHotkey.SetIsValid(true, null);
 }