Mantid
Loading...
Searching...
No Matches
MockJobTreeView.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
10#include <gmock/gmock.h>
11
12using testing::Return;
13
14namespace MantidQt {
15namespace MantidWidgets {
16namespace Batch {
17
19
21public:
22 MockJobTreeView() : m_deadCell("", "white", 0, "transparent", 0, false) {
23 ON_CALL(*this, deadCell()).WillByDefault(Return(m_deadCell));
24 }
25
26 void filterRowsBy(std::unique_ptr<RowPredicate> predicate) override { filterRowsBy(predicate.get()); }
28
31
33
34 MOCK_METHOD3(insertChildRowOf, RowLocation(RowLocation const &, int, std::vector<Cell> const &));
37 MOCK_METHOD2(appendChildRowOf, RowLocation(RowLocation const &, std::vector<Cell> const &));
41
43 MOCK_METHOD1(removeRows, void(std::vector<RowLocation>));
46
47 MOCK_METHOD2(replaceRows, void(std::vector<RowLocation>, std::vector<Subtree>));
48
49 MOCK_METHOD2(appendSubtreesAt, void(RowLocation const &, std::vector<Subtree>));
50 MOCK_METHOD2(appendSubtreeAt, void(RowLocation const &parent, Subtree const &subtree));
52 MOCK_METHOD3(insertSubtreeAt, void(RowLocation const &, int, Subtree const &));
53
57 MOCK_CONST_METHOD1(cellsAt, std::vector<Cell>(RowLocation const &));
58 MOCK_METHOD2(setCellsAt, void(RowLocation const &, std::vector<Cell> const &rowText));
59
61 MOCK_METHOD3(setCellAt, void(RowLocation, int, Cell const &));
62
64
65 void setHintsForColumn(int column, std::unique_ptr<MantidQt::MantidWidgets::HintStrategy> strategy) override {
66 setHintsForColumn(column, strategy.get());
67 }
68
69 MOCK_CONST_METHOD0(selectedRowLocations, std::vector<RowLocation>());
70 MOCK_CONST_METHOD0(selectedSubtrees, std::optional<std::vector<Subtree>>());
71 MOCK_CONST_METHOD0(selectedSubtreeRoots, std::optional<std::vector<RowLocation>>());
74
75private:
77};
78
80} // namespace Batch
81} // namespace MantidWidgets
82} // namespace MantidQt
#define GNU_DIAG_ON_SUGGEST_OVERRIDE
#define GNU_DIAG_OFF_SUGGEST_OVERRIDE
virtual std::optional< std::vector< RowLocation > > selectedSubtreeRoots() const =0
virtual std::vector< RowLocation > selectedRowLocations() const =0
virtual std::optional< std::vector< Subtree > > selectedSubtrees() const =0
virtual void appendSubtreesAt(RowLocation const &parent, std::vector< Subtree > subtrees)=0
virtual bool isOnlyChildOfRoot(RowLocation const &location) const =0
virtual void removeRows(std::vector< RowLocation > rowsToRemove)=0
virtual RowLocation insertChildRowOf(RowLocation const &parent, int beforeRow, std::vector< Cell > const &rowText)=0
virtual void appendSubtreeAt(RowLocation const &parent, Subtree const &subtree)=0
virtual void setCellsAt(RowLocation const &location, std::vector< Cell > const &rowText)=0
virtual void setCellAt(RowLocation location, int column, Cell const &cellText)=0
virtual void insertSubtreeAt(RowLocation const &parent, int index, Subtree const &subtree)=0
virtual void replaceSubtreeAt(RowLocation const &rootToRemove, Subtree const &toInsert)=0
virtual Cell cellAt(RowLocation location, int column) const =0
virtual void removeRowAt(RowLocation const &location)=0
virtual RowLocation appendChildRowOf(RowLocation const &parent)=0
virtual std::vector< Cell > cellsAt(RowLocation const &location) const =0
virtual void replaceRows(std::vector< RowLocation > replacementPoints, std::vector< Subtree > replacements)=0
virtual void subscribe(JobTreeViewSubscriber *subscriber)=0
MOCK_METHOD0(appendAndEditAtRowBelow, void())
MOCK_CONST_METHOD0(selectedSubtrees, std::optional< std::vector< Subtree > >())
MOCK_METHOD1(filterRowsBy, void(RowPredicate *))
MOCK_METHOD1(removeRowAt, void(RowLocation const &))
MOCK_CONST_METHOD1(isOnlyChildOfRoot, bool(RowLocation const &))
MOCK_METHOD2(replaceRows, void(std::vector< RowLocation >, std::vector< Subtree >))
MOCK_METHOD1(subscribe, void(JobTreeViewSubscriber *))
void setHintsForColumn(int column, std::unique_ptr< MantidQt::MantidWidgets::HintStrategy > strategy) override
MOCK_CONST_METHOD0(selectedSubtreeRoots, std::optional< std::vector< RowLocation > >())
MOCK_METHOD0(appendAndEditAtChildRow, void())
MOCK_METHOD3(setCellAt, void(RowLocation, int, Cell const &))
MOCK_METHOD2(replaceSubtreeAt, void(RowLocation const &, Subtree const &))
MOCK_CONST_METHOD1(cellsAt, std::vector< Cell >(RowLocation const &))
MOCK_METHOD2(insertChildRowOf, RowLocation(RowLocation const &, int))
MOCK_METHOD3(insertSubtreeAt, void(RowLocation const &, int, Subtree const &))
MOCK_METHOD2(appendChildRowOf, RowLocation(RowLocation const &, std::vector< Cell > const &))
MOCK_METHOD2(appendSubtreeAt, void(RowLocation const &parent, Subtree const &subtree))
MOCK_CONST_METHOD0(selectedRowLocations, std::vector< RowLocation >())
MOCK_METHOD1(removeRows, void(std::vector< RowLocation >))
MOCK_METHOD1(appendChildRowOf, RowLocation(RowLocation const &))
MOCK_CONST_METHOD2(cellAt, Cell(RowLocation, int))
MOCK_METHOD2(setCellsAt, void(RowLocation const &, std::vector< Cell > const &rowText))
void filterRowsBy(std::unique_ptr< RowPredicate > predicate) override
MOCK_METHOD3(insertChildRowOf, RowLocation(RowLocation const &, int, std::vector< Cell > const &))
MOCK_METHOD2(appendSubtreesAt, void(RowLocation const &, std::vector< Subtree >))
MOCK_METHOD2(setHintsForColumn, void(int, MantidQt::MantidWidgets::HintStrategy *))
HintStrategy : Provides an interface for generating hints to be used by a HintingLineEdit.
std::vector< Row > Subtree
Definition Subtree.h:20
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...