예제 #1
0
 public RecentFileMenuHandler(MenuItem menu, ITestModel model, Func <string, bool> fileExists)
 {
     Menu            = menu;
     UserSettings    = model.Services.UserSettings;
     RecentFiles     = model.Services.RecentFiles;
     this.fileExists = fileExists;
 }
예제 #2
0
 public TestListDisplayStrategy(ITestTreeView view, ITestModel model) : base(view, model)
 {
     _groupBy  = _model.Settings.Gui.TestTree.TestList.GroupBy;
     _grouping = CreateTestGrouping(_groupBy);
     _view.GroupBy.SelectedItem = _groupBy;
     _view.CollapseToFixturesCommand.Enabled = false;
 }
        public void CreateDisplayStrategy()
        {
            _view  = Substitute.For <ITestTreeView>();
            _model = Substitute.For <ITestModel>();

            new NUnitTreeDisplayStrategy(_view, _model);
        }
        public async Task SHOULD_update_subscribers()
        {
            //Arrange
            var id = Guid.NewGuid();
            await Sut.InitializeAsync(id);

            var resultOne = await Sut.GetModelAsync();

            ITestModel resultTwo = null;
            await Sut.SubscribeAsync(testModel =>
            {
                resultTwo = testModel;
                return(Task.CompletedTask);
            });

            //Act
            await Sut.ReloadAsync();

            //Assert
            Assert.That(resultTwo, Is.Not.EqualTo(resultOne));
            Assert.That(resultOne.RandomThing, Is.Not.EqualTo(resultTwo.RandomThing));

            Assert.That(resultOne.Id, Is.EqualTo(id));
            Assert.That(resultOne.Id, Is.EqualTo(resultTwo.Id));
        }
        public void CreateDisplayStrategy()
        {
            _view = Substitute.For<ITestTreeView>();
            _model = Substitute.For<ITestModel>();

            _strategy = GetDisplayStrategy();
        }
예제 #6
0
 // NOTE: We have to keep a default constructor for design mode
 public SettingsDialogBase(TestCentricPresenter presenter, ITestModel model) : this()
 {
     Presenter             = presenter;
     Model                 = model;
     Settings              = model.Settings;
     PackageSettingChanges = new Dictionary <string, object>();
 }
예제 #7
0
        public void InitializeView(ITestModel model, TestCentricPresenter presenter)
        {
            Settings = model.Services.UserSettings;

            tabControl.SelectedIndex = Settings.Gui.SelectedTab;

            model.Events.TestLoaded += (TestNodeEventArgs e) =>
            {
                Clear();
            };

            model.Events.TestUnloaded += (TestEventArgs e) =>
            {
                Clear();
            };

            model.Events.TestReloaded += (TestNodeEventArgs e) =>
            {
                if (Settings.Gui.ClearResultsOnReload)
                {
                    this.Clear();
                }
            };

            model.Events.RunStarting += (RunStartingEventArgs e) =>
            {
                Clear();
            };
        }
예제 #8
0
        public TestsNotRunPresenter(ITestsNotRunView view, ITestModel model)
        {
            _view  = view;
            _model = model;

            WireUpEvents();
        }
예제 #9
0
 public void Initialize()
 {
     _view     = Substitute.For <TView>();
     _model    = Substitute.For <ITestModel>();
     _settings = new FakeUserSettings();
     _model.Services.UserSettings.Returns(_settings);
 }
예제 #10
0
        public void CreatePresenter()
        {
            View  = Substitute.For <IMainView>();
            Model = Substitute.For <ITestModel>();

            Presenter = new MainPresenter(View, Model);
        }
예제 #11
0
        public ProgressBarPresenter(IProgressBarView view, ITestModel model)
        {
            _view  = view;
            _model = model;

            WireUpEvents();
        }
예제 #12
0
        public void CreatePresenter()
        {
            _view  = Substitute.For <IStatusBarView>();
            _model = Substitute.For <ITestModel>();

            _presenter = new StatusBarPresenter(_view, _model);
        }
예제 #13
0
 public TestListDisplayStrategy(ITestTreeView view, ITestModel model) : base(view, model) 
 {
     _groupBy = _model.Settings.Gui.TestTree.TestList.GroupBy;
     _grouping = CreateTestGrouping(_groupBy);
     _view.GroupBy.SelectedItem = _groupBy;
     _view.CollapseToFixturesCommand.Enabled = false;
 }
        public void CreateDisplayStrategy()
        {
            _view = Substitute.For<ITestTreeView>();
            _model = Substitute.For<ITestModel>();

            new NUnitTreeDisplayStrategy(_view, _model);
        }
예제 #15
0
        public StatusBarPresenter(IStatusBarView view, ITestModel model)
        {
            _view = view;
            _model = model;

            WireUpEvents();
        }
        public void CreatePresenter()
        {
            View  = Substitute.For <IMainView>();
            Model = Substitute.For <ITestModel>();

            Presenter = new MainPresenter(View, Model, new CommandLineOptions());
        }
        public ProgressBarPresenter(IProgressBarView progressBar, ITestModel model)
        {
            _progressBar = progressBar;
            _model       = model;

            WireUpEvents();
        }
예제 #18
0
        public DisplayStrategy(ITestTreeView view, ITestModel model)
        {
            _view = view;
            _model = model;

            this.Tree = view.Tree;
        }
예제 #19
0
        public DisplayStrategy(ITestTreeView view, ITestModel model)
        {
            _view  = view;
            _model = model;

            this.Tree = view.Tree;
        }
예제 #20
0
        public void CreatePresenter()
        {
            View = Substitute.For<IMainView>();
            Model = Substitute.For<ITestModel>();

            Presenter = new MainPresenter(View, Model);
        }
예제 #21
0
        public StatusBarPresenter(IStatusBarView view, ITestModel model)
        {
            _view  = view;
            _model = model;

            WireUpEvents();
        }
        public void CreateDisplayStrategy()
        {
            _view  = Substitute.For <ITestTreeView>();
            _model = Substitute.For <ITestModel>();

            _strategy = GetDisplayStrategy();
        }
예제 #23
0
        public TestPropertiesDisplay(ITestModel model, ITestTreeView view)
        {
            _model = model;
            _view  = view;

            InitializeComponent();
        }
        public TreeBasedSettingsDialog(TestCentricPresenter presenter, ITestModel model) : base(presenter, model)
        {
            // This call is required by the Windows Form Designer.
            InitializeComponent();

            // TODO: Add any initialization after the InitializeComponent call
        }
예제 #25
0
        public void CreatePresenter()
        {
            _view = Substitute.For<IStatusBarView>();
            _model = Substitute.For<ITestModel>();

            _presenter = new StatusBarPresenter(_view, _model);
        }
        // TODO: Use an interface for view
        public TestCentricPresenter(IMainView view, ITestModel model, CommandLineOptions options)
        {
            _view    = view;
            _model   = model;
            _options = options;

            _settings    = _model.Settings;
            _recentFiles = _model.RecentFiles;

            _agentSelectionController = new AgentSelectionController(_model, _view);

            _view.Font = _settings.Gui.Font;
            _view.ResultTabs.SelectedIndex = _settings.Gui.SelectedTab;

            SetTreeDisplayFormat(_settings.Gui.TestTree.DisplayFormat);

            UpdateViewCommands();
            _view.StopRunMenuCommand.Visible   = true;
            _view.StopRunButton.Visible        = true;
            _view.ForceStopMenuCommand.Visible = false;
            _view.ForceStopButton.Visible      = false;
            _view.RunSummaryButton.Visible     = false;

            foreach (string format in _model.ResultFormats)
            {
                if (format != "cases" && format != "user")
                {
                    _resultFormats.Add(format);
                }
            }

            WireUpEvents();
        }
예제 #27
0
        // TODO: Use an interface for view
        public TestCentricPresenter(IMainView view, ITestModel model, CommandLineOptions options)
        {
            _view    = view;
            _model   = model;
            _options = options;

            _settings    = _model.Settings;
            _recentFiles = _model.RecentFiles;
            _runtimeSelectionController = new RuntimeSelectionController(_view.RuntimeMenu, _model);

            _view.Font = _settings.Gui.Font;
            _view.ResultTabs.SelectedIndex = _settings.Gui.SelectedTab;

            UpdateViewCommands();

            foreach (string format in _model.ResultFormats)
            {
                if (format != "cases" && format != "user")
                {
                    _resultFormats.Add(format);
                }
            }

            WireUpEvents();
        }
예제 #28
0
        public SimpleSettingsDialog(ITestModel model) : base(model)
        {
            // This call is required by the Windows Form Designer.
            InitializeComponent();

            // TODO: Add any initialization after the InitializeComponent call
        }
예제 #29
0
        public TreeViewPresenter(ITestTreeView treeView, ITestModel model)
        {
            _view = treeView;
            _model = model;

            InitializeRunCommands();
            WireUpEvents();
        }
예제 #30
0
        public ProxyTest()
        {
            var        config = new MemstateSettings().WithInmemoryStorage();
            ITestModel model  = new TestModel();

            _engine = new EngineBuilder(config).Build(model);
            _proxy  = new LocalClient <ITestModel>(_engine).GetDispatchProxy();
        }
 public void Initialize()
 {
     _menu  = new PopupMenuElement(new ToolStripMenuItem("Runtimes"));
     _model = Substitute.For <ITestModel>();
     _model.AvailableRuntimes.Returns(AvailableRuntimes);
     _package    = new TestPackage("dummy.dll");
     _controller = new RuntimeSelectionController(_menu, _model);
 }
예제 #32
0
        public void CreatePresenter()
        {
            _view = Substitute.For<ITestTreeView>();
            _model = Substitute.For<ITestModel>();
            _model.Settings.Returns<SettingsModel>(new SettingsModel(new UserSettingsFake()));

            _presenter = new TreeViewPresenter(_view, _model);
        }
예제 #33
0
 public TestPresenter(ITestView testView)
 {
     this.testView         = testView;
     testModel             = new TestModel();
     testView.SearchClick += LoadSearchResultGrid;
     testView.ClearClick  += LoadAllTestGrids;
     testView.LoadForm    += LoadAllTestGrids;
 }
        public DisplayStrategy(ITestTreeView view, ITestModel model)
        {
            _view     = view;
            _model    = model;
            _settings = new SettingsModel(_model.GetService <ISettings>());

            this.Tree = view.Tree;
        }
예제 #35
0
        public DisplayStrategy(ITestTreeView view, ITestModel model)
        {
            _view     = view;
            _model    = model;
            _settings = _model.Services.UserSettings;

            this.Tree = view.Tree;
        }
예제 #36
0
        public CategoryPresenter(ICategoryView view, ITestModel model)
        {
            _model    = model;
            _view     = view;
            _settings = model.Services.UserSettings;

            WireUpEvents();
        }
예제 #37
0
        public ProgressBarPresenter(IProgressBarView progressBar, ITestModel model)
        {
            _progressBar = progressBar;
            //_progressBar.Initialize(100);
            _model = model;

            WireUpEvents();
        }
예제 #38
0
        public void CreatePresenter()
        {
            View  = Substitute.For <IMainView>();
            Model = Substitute.For <ITestModel>();
            Model.Settings.Returns(new TestCentric.TestUtilities.Fakes.UserSettings());

            Presenter = new MainPresenter(View, Model, new CommandLineOptions());
        }
예제 #39
0
 public void Initialize()
 {
     _view     = Substitute.For <TView>();
     _model    = Substitute.For <ITestModel>();
     _settings = new FakeUserSettings();
     _model.Settings.Returns(_settings);
     _model.TestFiles.Returns(new List <string>());
 }
예제 #40
0
        public MainPresenter(IMainView view, ITestModel model)
        {
            _view  = view;
            _model = model;

            InitializeMainMenu();
            WireUpEvents();
        }
예제 #41
0
        public MainPresenter(IMainView view, ITestModel model)
        {
            _view = view;
            _model = model;

            InitializeMainMenu();
            WireUpEvents();
        }
예제 #42
0
        public XmlPresenter(IXmlView view, ITestModel model)
        {
            _view = view;
            _model = model;

            _view.Visible = false;

            WireUpEvents();
        }
예제 #43
0
        public void CreateTestModel()
        {
            var engine = TestEngineActivator.CreateInstance();
            Assert.NotNull(engine, "Unable to create engine instance for testing");

            _model = new TestModel(engine, new CommandLineOptions());

            _model.LoadTests(new []{MOCK_ASSEMBLY});
        }
        public TestPropertiesPresenter(ITestPropertiesView view, ITestModel model)
        {
            _view = view;
            _model = model;

            _view.Visible = false;

            WireUpEvents();
        }
예제 #45
0
        public void CreateTestModel()
        {
            var engine = TestEngineActivator.CreateInstance();
            Assert.NotNull(engine, "Unable to create engine instance for testing");

            _model = new TestModel(engine);

            _model.LoadTests(new TestPackage(MOCK_ASSEMBLY));
        }
예제 #46
0
        public DisplayStrategy(ITestTreeView view, ITestModel model)
        {
            _view = view;
            _model = model;

            this.Tree = view.Tree;
            
            //CreateContextMenu();

            WireUpEvents();
        }
예제 #47
0
        public MainPresenter(IMainView view, ITestModel model, GuiOptions options)
        {
            _view = view;
            _model = model;
            _options = options;

            _recentFilesService = _model.GetService<IRecentFiles>();

            InitializeMainMenu();
            WireUpEvents();
        }
        public FixtureListDisplayStrategy(ITestTreeView view, ITestModel model) : base(view, model)
        {
            SetDefaultTestGrouping();
            _view.CollapseToFixturesCommand.Enabled = true;

            // Ugly Hack! We should not be referencing view components here.
            // TODO: Create a better inteface for a CheckedMenuGroup
            var checkedMenuGroup = _view.GroupBy as UiKit.Elements.CheckedMenuGroup;
            if (checkedMenuGroup != null)
                checkedMenuGroup.EnableItem("FIXTURE", false);
        }
예제 #49
0
        public void CreatePresenter()
        {
            _view = Substitute.For<ITestTreeView>();
            _model = Substitute.For<ITestModel>();
            _model.Settings.Returns<SettingsModel>(new SettingsModel(new UserSettingsFake()));

            _presenter = new TreeViewPresenter(_view, _model);

            // Make it look like the view loaded
            _view.Load += Raise.Event<System.EventHandler>(null, new System.EventArgs());
        }
예제 #50
0
        public TreeViewPresenter(ITestTreeView treeView, ITestModel model)
        {
            _view = treeView;
            _model = model;

            // Create the initial display, which assists the presenter
            // both by providing public methods and by handling events.
            _displayFormat = _model.Settings.Gui.TestTree.DisplayFormat;
            _display = CreateDisplayStrategy(_displayFormat);
            _view.FormatButton.ToolStripItem.ToolTipText = _display.Description;

            InitializeRunCommands();
            WireUpEvents();
        }
 public ImplementationWithConstructorParameters(ITestModel<string> testModel)
 {
     TestModel = testModel;
 }
예제 #52
0
        public void CreateTestModel()
        {
            var engine = TestEngineActivator.CreateInstance();
            Assert.NotNull(engine, "Unable to create engine instance for testing");

            _model = new TestModel(engine, new CommandLineOptions());

            _model.LoadTests(new[] { Path.Combine(TestContext.CurrentContext.TestDirectory, MOCK_ASSEMBLY) });
        }
예제 #53
0
 public GroupDisplayStrategy(ITestTreeView view, ITestModel model)
     : base(view, model) 
 {
     _view.GroupBy.Enabled = true;
     _view.GroupBy.SelectionChanged += OnGroupByChanged;
 }
 public NUnitTreeDisplayStrategy(ITestTreeView view, ITestModel model) : base(view, model) 
 {
     _view.GroupBy.Enabled = false;
     _view.CollapseToFixturesCommand.Enabled = true;
 }
 public TestListDisplayStrategy(ITestTreeView view, ITestModel model) : base(view, model) 
 {
     SetDefaultTestGrouping();
     _view.CollapseToFixturesCommand.Enabled = false;
 }