Ejemplo n.º 1
0
        public void PressingAltAConvertsSelectedItemsToActions()
        {
            var expected_item = new InBoxItem("foo");
            var expected_item2 = new InBoxItem("foo2");
            _view.Stub(x => x.SelectedItems).Return(new List<GTDItem> { expected_item, expected_item2 });

            _view.Raise(x => x.AltAKeysWasPressed += null);

            _converter.AssertWasCalled(x => x.ConvertToAction(Arg<InBoxItem>.Is.Equal(expected_item)));
            _converter.AssertWasCalled(x => x.ConvertToAction(Arg<InBoxItem>.Is.Equal(expected_item2)));
        }
Ejemplo n.º 2
0
        public void ActionButtonClickConvertsSelectedItemsToAction()
        {
            var expected_item = new InBoxItem("foo");
            var expected_item2 = new InBoxItem("foo2");
            _view.Stub(x => x.SelectedItems).Return(new List<GTDItem> { expected_item, expected_item2 });

            _view.Raise(x => x.ToActionButtonWasClicked += null);

            _converter.AssertWasCalled(x => x.ConvertToAction(Arg<InBoxItem>.Is.Equal(expected_item)));
            _converter.AssertWasCalled(x => x.ConvertToAction(Arg<InBoxItem>.Is.Equal(expected_item2)));
        }
Ejemplo n.º 3
0
 public ActionItem ConvertToAction(InBoxItem item)
 {
     _inbox_model.Remove(item);
     ActionItem action = _actions_list_model.Add(item.Name);
     return action;
 }
Ejemplo n.º 4
0
 protected virtual bool Equals(InBoxItem obj)
 {
     if (ReferenceEquals(null, obj)) return false;
     if (ReferenceEquals(this, obj)) return true;
     return Equals(obj._name, _name) && obj.Id == Id;
 }
Ejemplo n.º 5
0
 public void ConvertToAction_OnNonExistantItem_DoesNotThrow()
 {
     var item = new InBoxItem("foo");
     _converter.ConvertToAction(item);
 }