Exemplo n.º 1
0
        public void Invoke()
        {
            var persistedProject = new Mock<IPersistenceInformation>();

            Func<IPersistenceInformation, IProject> function = persistenceInfo =>
            {
                Assert.AreEqual(persistedProject.Object, persistenceInfo);
                return new Mock<IProject>().Object;
            };
            var command = new LoadProjectCommand(function);

            var context = new LoadProjectContext
                {
                    LoadFrom = persistedProject.Object,
                };
            command.Invoke(context);
            Assert.IsNotNull(context.Result);
        }
Exemplo n.º 2
0
        public void Invoke()
        {
            var persistedProject = new Mock <IPersistenceInformation>();

            Func <IPersistenceInformation, IProject> function = persistenceInfo =>
            {
                Assert.AreEqual(persistedProject.Object, persistenceInfo);
                return(new Mock <IProject>().Object);
            };
            var command = new LoadProjectCommand(function);

            var context = new LoadProjectContext
            {
                LoadFrom = persistedProject.Object,
            };

            command.Invoke(context);
            Assert.IsNotNull(context.Result);
        }