public ControlBusTests()
        {
            _dispatcher = A.Fake <IDispatcher>();
            var messageProducerFactory = A.Fake <IAmAProducerRegistryFactory>();

            _busReceiverBuilder = (ControlBusReceiverBuilder)ControlBusReceiverBuilder
                                  .With()
                                  .Dispatcher(_dispatcher)
                                  .ProducerRegistryFactory(messageProducerFactory)
                                  .ChannelFactory(new InMemoryChannelFactory());

            _controlBus = _busReceiverBuilder.Build("tests");

            _configurationCommand = new ConfigurationCommand(ConfigurationCommandType.CM_STARTALL);
        }
Exemplo n.º 2
0
        public SolutionViewModel(ISolution model) : base(model)
        {
            shell = IoC.Get <IShell>();

            Projects   = new ObservableCollection <ProjectViewModel>();
            IsExpanded = true;

            Projects.BindCollections(model.Projects, p => { return(ProjectViewModel.Create(this, p)); },
                                     (pvm, p) => pvm.Model == p);

            NewProjectCommand = ReactiveCommand.Create();
            NewProjectCommand.Subscribe(o =>
            {
                shell.ModalDialog = new NewProjectDialogViewModel(model);
                shell.ModalDialog.ShowDialog();
            });

            AddExistingProjectCommand = ReactiveCommand.Create();
            AddExistingProjectCommand.Subscribe(async o =>
            {
                var dlg   = new OpenFileDialog();
                dlg.Title = "Open Project";

                var extensions = new List <string>();

                foreach (var projectType in shell.ProjectTypes)
                {
                    extensions.AddRange(projectType.Extensions);
                }

                dlg.Filters.Add(new FileDialogFilter {
                    Name = "AvalonStudio Project", Extensions = extensions
                });
                dlg.InitialFileName  = string.Empty;
                dlg.InitialDirectory = Model.CurrentDirectory;
                dlg.AllowMultiple    = false;

                var result = await dlg.ShowAsync();

                if (result != null && result.Length == 1)
                {
                    var proj = Solution.LoadProjectFile(model, result[0]);

                    if (proj != null)
                    {
                        model.AddProject(proj);
                        model.Save();
                    }
                }
            });

            OpenInExplorerCommand = ReactiveCommand.Create();
            OpenInExplorerCommand.Subscribe(o => { Platform.OpenFolderInExplorer(model.CurrentDirectory); });

            ConfigurationCommand = ReactiveCommand.Create();
            ConfigurationCommand.Subscribe(o =>
            {
                //Workspace.Instance.ModalDialog = new SolutionConfigurationDialogViewModel(Workspace.Instance.SolutionExplorer.Model);
                //Workspace.Instance.ModalDialog.ShowDialog();
            });

            BuildSolutionCommand = ReactiveCommand.Create();
            BuildSolutionCommand.Subscribe(o => { BuildSolution(); });

            CleanSolutionCommand = ReactiveCommand.Create();
            CleanSolutionCommand.Subscribe(o => { CleanSolution(); });

            RebuildSolutionCommand = ReactiveCommand.Create();
            RebuildSolutionCommand.Subscribe(o =>
            {
                CleanSolution();

                BuildSolution();
            });

            RunAllTestsCommand = ReactiveCommand.Create();
            RunAllTestsCommand.Subscribe(o => { RunTests(); });
        }
 public void Establish()
 {
     _dispatcher = A.Fake <IDispatcher>();
     _configurationCommandHandler = new ConfigurationCommandHandler(_dispatcher);
     _configurationCommand        = new ConfigurationCommand(ConfigurationCommandType.CM_STARTALL);
 }
Exemplo n.º 4
0
 public ConfigurationCommandAllStopTests()
 {
     _dispatcher = A.Fake <IDispatcher>();
     _configurationCommandHandler = new ConfigurationCommandHandler(_dispatcher);
     _configurationCommand        = new ConfigurationCommand(ConfigurationCommandType.CM_STOPALL);
 }