public RecentFileMenuHandler(MenuItem menu, ITestModel model, Func <string, bool> fileExists) { Menu = menu; UserSettings = model.Services.UserSettings; RecentFiles = model.Services.RecentFiles; this.fileExists = fileExists; }
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(); }
// 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>(); }
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(); }; }
public TestsNotRunPresenter(ITestsNotRunView view, ITestModel model) { _view = view; _model = model; WireUpEvents(); }
public void Initialize() { _view = Substitute.For <TView>(); _model = Substitute.For <ITestModel>(); _settings = new FakeUserSettings(); _model.Services.UserSettings.Returns(_settings); }
public void CreatePresenter() { View = Substitute.For <IMainView>(); Model = Substitute.For <ITestModel>(); Presenter = new MainPresenter(View, Model); }
public ProgressBarPresenter(IProgressBarView view, ITestModel model) { _view = view; _model = model; WireUpEvents(); }
public void CreatePresenter() { _view = Substitute.For <IStatusBarView>(); _model = Substitute.For <ITestModel>(); _presenter = new StatusBarPresenter(_view, _model); }
public void CreateDisplayStrategy() { _view = Substitute.For<ITestTreeView>(); _model = Substitute.For<ITestModel>(); new NUnitTreeDisplayStrategy(_view, _model); }
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(); }
public DisplayStrategy(ITestTreeView view, ITestModel model) { _view = view; _model = model; this.Tree = view.Tree; }
public void CreatePresenter() { View = Substitute.For<IMainView>(); Model = Substitute.For<ITestModel>(); Presenter = new MainPresenter(View, Model); }
public void CreateDisplayStrategy() { _view = Substitute.For <ITestTreeView>(); _model = Substitute.For <ITestModel>(); _strategy = GetDisplayStrategy(); }
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 }
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(); }
// 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(); }
public SimpleSettingsDialog(ITestModel model) : base(model) { // This call is required by the Windows Form Designer. InitializeComponent(); // TODO: Add any initialization after the InitializeComponent call }
public TreeViewPresenter(ITestTreeView treeView, ITestModel model) { _view = treeView; _model = model; InitializeRunCommands(); WireUpEvents(); }
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); }
public void CreatePresenter() { _view = Substitute.For<ITestTreeView>(); _model = Substitute.For<ITestModel>(); _model.Settings.Returns<SettingsModel>(new SettingsModel(new UserSettingsFake())); _presenter = new TreeViewPresenter(_view, _model); }
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; }
public DisplayStrategy(ITestTreeView view, ITestModel model) { _view = view; _model = model; _settings = _model.Services.UserSettings; this.Tree = view.Tree; }
public CategoryPresenter(ICategoryView view, ITestModel model) { _model = model; _view = view; _settings = model.Services.UserSettings; WireUpEvents(); }
public ProgressBarPresenter(IProgressBarView progressBar, ITestModel model) { _progressBar = progressBar; //_progressBar.Initialize(100); _model = model; WireUpEvents(); }
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()); }
public void Initialize() { _view = Substitute.For <TView>(); _model = Substitute.For <ITestModel>(); _settings = new FakeUserSettings(); _model.Settings.Returns(_settings); _model.TestFiles.Returns(new List <string>()); }
public MainPresenter(IMainView view, ITestModel model) { _view = view; _model = model; InitializeMainMenu(); WireUpEvents(); }
public XmlPresenter(IXmlView view, ITestModel model) { _view = view; _model = model; _view.Visible = false; WireUpEvents(); }
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(); }
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)); }
public DisplayStrategy(ITestTreeView view, ITestModel model) { _view = view; _model = model; this.Tree = view.Tree; //CreateContextMenu(); WireUpEvents(); }
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); }
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()); }
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; }
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) }); }
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; }