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()); }
27 MOCK_METHOD1(filterRowsBy, void(RowPredicate *));
28
29 MOCK_METHOD0(resetFilter, void());
30 MOCK_CONST_METHOD0(hasFilter, bool());
31
33
34 MOCK_METHOD3(insertChildRowOf, RowLocation(RowLocation const &, int, std::vector<Cell> const &));
35 MOCK_METHOD2(insertChildRowOf, RowLocation(RowLocation const &, int));
36 MOCK_METHOD1(appendChildRowOf, RowLocation(RowLocation const &));
37 MOCK_METHOD2(appendChildRowOf, RowLocation(RowLocation const &, std::vector<Cell> const &));
38 MOCK_METHOD0(appendAndEditAtChildRow, void());
39 MOCK_METHOD0(appendAndEditAtRowBelow, void());
40 MOCK_METHOD0(editAtRowAbove, void());
41
42 MOCK_METHOD1(removeRowAt, void(RowLocation const &));
43 MOCK_METHOD1(removeRows, void(std::vector<RowLocation>));
44 MOCK_METHOD0(removeAllRows, void());
45 MOCK_CONST_METHOD1(isOnlyChildOfRoot, bool(RowLocation const &));
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));
51 MOCK_METHOD2(replaceSubtreeAt, void(RowLocation const &, Subtree const &));
52 MOCK_METHOD3(insertSubtreeAt, void(RowLocation const &, int, Subtree const &));
53
54 MOCK_METHOD0(clearSelection, void());
55 MOCK_METHOD0(expandAll, void());
56 MOCK_METHOD0(collapseAll, void());
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
63 MOCK_METHOD2(setHintsForColumn, void(int, MantidQt::MantidWidgets::HintStrategy *));
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, boost::optional<std::vector<Subtree>>());
71 MOCK_CONST_METHOD0(selectedSubtreeRoots, boost::optional<std::vector<RowLocation>>());
72 MOCK_CONST_METHOD0(currentColumn, int());
74
75private:
77};
78
80} // namespace Batch
81} // namespace MantidWidgets
82} // namespace MantidQt
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
Definition: System.h:53
#define GNU_DIAG_ON_SUGGEST_OVERRIDE
#define GNU_DIAG_OFF_SUGGEST_OVERRIDE
MOCK_METHOD0(appendAndEditAtRowBelow, void())
MOCK_METHOD1(filterRowsBy, void(RowPredicate *))
MOCK_METHOD1(removeRowAt, void(RowLocation const &))
MOCK_CONST_METHOD1(isOnlyChildOfRoot, bool(RowLocation const &))
MOCK_CONST_METHOD0(selectedSubtreeRoots, boost::optional< std::vector< RowLocation > >())
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(selectedSubtrees, boost::optional< std::vector< Subtree > >())
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.
Definition: HintStrategy.h:19
std::vector< Row > Subtree
Definition: Subtree.h:18
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...