public void DefaultActionForItemAppearsFirst() { var act = new MockActOnFileInfo(); var defaultAct = new MockDefaultActOnFileInfo(); var info = new FileInfoItem(new FileInfo("does.not.exist")); var getItems = new GetActionsForItem(new IActOnItem[] { act, defaultAct }, new FakeFindDefaultActionForItemStrategy(defaultAct)); var actionsForItem = getItems.ActionsForItem(ResultForItem(info)); Assert.NotEmpty(actionsForItem); Assert.Contains(defaultAct, actionsForItem); Assert.Equal(defaultAct, actionsForItem.First()); }
public void AttributeStrategyForDefaultActionForFileInfoShowsDoesNotFindAction() { var act = new MockActOnFileInfo(); var defaultAct = new MockDefaultActOnFileInfo(); var run = new Run(); var info = new FileInfoItem(new FileInfo("does.not.exist")); var actions = new IActOnItem[] { act, defaultAct }; var strategy = new GetDefaultActionBasedOnAttributeForType(); strategy.Actions = actions; var getItems = new GetActionsForItem(actions, strategy); var actionsForItem = getItems.ActionsForItem(ResultForItem(info)); Assert.NotEmpty(actionsForItem); Assert.DoesNotContain(run, actionsForItem); }