Ejemplo n.º 1
0
        private EducationViewModel CreateEducationViewModel(bool useAutoMock = false)
        {
            EducationViewModel viewModel = null;
            var scheduler = new SynchronousTaskScheduler();

            Task.Factory.StartNew(
                () =>
            {
                if (useAutoMock)
                {
                    viewModel = this.fixture.Create <EducationViewModel>();
                }
                else
                {
                    viewModel = new EducationViewModel(
                        this.unitOfWorkMock.Object,
                        this.viewModelBuilderMock.Object,
                        this.viewBuilderMock.Object,
                        this.messageBoxProviderMock.Object,
                        this.educationCacheMock.Object);
                }
            },
                CancellationToken.None,
                TaskCreationOptions.None,
                scheduler);

            return(viewModel);
        }
        private void ConcurrentExecute(ICommand command)
        {
            var scheduler = new SynchronousTaskScheduler();

            Task.Factory.StartNew(
                () =>
            {
                command.Execute(null);
            },
                CancellationToken.None,
                TaskCreationOptions.None,
                scheduler);
        }