public void CanLoadProjectWithNullFacade() { Func <string, IDisposable> timerFunc = s => new MockDisposable(); var command = new OpenProjectCommand(null, timerFunc); Assert.IsFalse(command.CanExecute(null)); }
public void CanLoadProjectWhileUnableToLoad() { var project = new Mock <ILinkToProjects>(); { project.Setup(p => p.CanLoadProject()) .Returns(false); } Func <string, IDisposable> timerFunc = s => new MockDisposable(); var command = new OpenProjectCommand(project.Object, timerFunc); Assert.IsFalse(command.CanExecute(null)); }
public void LoadProject() { var project = new Mock <ILinkToProjects>(); { project.Setup(p => p.LoadProject(It.IsAny <IPersistenceInformation>())) .Verifiable(); } Func <string, IDisposable> timerFunc = s => new MockDisposable(); var command = new OpenProjectCommand(project.Object, timerFunc); var persistence = new Mock <IPersistenceInformation>(); command.Execute(persistence.Object); project.Verify(p => p.LoadProject(It.IsAny <IPersistenceInformation>()), Times.Once()); }