public void CanRedoWithoutMarkers() { var currentMark = new TimeMarker(10); var markers = new List <TimeMarker>(); var history = new Mock <ITimeline>(); { history.Setup(h => h.CanRollForward) .Returns(true); history.Setup(h => h.MarkersInTheFuture()) .Returns(markers); history.Setup(h => h.Current) .Returns(currentMark); } var project = new Mock <IProject>(); { project.Setup(p => p.History) .Returns(history.Object); } var projectFacade = new ProjectFacade(project.Object); var projectLink = new Mock <ILinkToProjects>(); { projectLink.Setup(p => p.ActiveProject()) .Returns(projectFacade); projectLink.Setup(p => p.HasActiveProject()) .Returns(true); } Func <string, IDisposable> timerFunc = s => new MockDisposable(); var command = new RedoCommand(projectLink.Object, timerFunc); Assert.IsFalse(command.CanExecute(null)); }
public void CanRedoWithHistoryWithoutRollForward() { var history = new Mock <ITimeline>(); { history.Setup(h => h.CanRollForward) .Returns(false); } var project = new Mock <IProject>(); { project.Setup(p => p.History) .Returns(history.Object); } var projectFacade = new ProjectFacade(project.Object); var projectLink = new Mock <ILinkToProjects>(); { projectLink.Setup(p => p.ActiveProject()) .Returns(projectFacade); } Func <string, IDisposable> timerFunc = s => new MockDisposable(); var command = new RedoCommand(projectLink.Object, timerFunc); Assert.IsFalse(command.CanExecute(null)); }
public void CanRedoWithNullFacade() { Func <string, IDisposable> timerFunc = s => new MockDisposable(); var command = new RedoCommand(null, timerFunc); Assert.IsFalse(command.CanExecute(null)); }
public void CanRedoWithoutActiveProject() { var projectLink = new Mock <ILinkToProjects>(); { projectLink.Setup(p => p.HasActiveProject()) .Returns(false); } Func <string, IDisposable> timerFunc = s => new MockDisposable(); var command = new RedoCommand(projectLink.Object, timerFunc); Assert.IsFalse(command.CanExecute(null)); }