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);
        }
Esempio 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);
        }