Exemplo n.º 1
0
        public void CanLoadProjectWithNullFacade()
        {
            Func <string, IDisposable> timerFunc = s => new MockDisposable();

            var command = new OpenProjectCommand(null, timerFunc);

            Assert.IsFalse(command.CanExecute(null));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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());
        }