Mantid
Loading...
Searching...
No Matches
MockAlgorithmRunner.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2019 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
8
12
13#include <gmock/gmock.h>
14
15using namespace MantidQt::API;
16
18
20public:
23 MOCK_METHOD1(startAlgorithmImpl, void(Mantid::API::IAlgorithm_sptr));
25
26 // Wrapper around startAlgorithmImpl to allow us to record
27 // which algorithm was started
29 m_algorithm = alg;
30 startAlgorithmImpl(alg);
31 }
32
34
35private:
37};
38
#define GNU_DIAG_ON_SUGGEST_OVERRIDE
#define GNU_DIAG_OFF_SUGGEST_OVERRIDE
The AlgorithmRunner is a QObject that encapsulates methods for running an algorithm asynchronously (i...
virtual void cancelRunningAlgorithm()
If an algorithm is already running, cancel it.
virtual Mantid::API::IAlgorithm_sptr getAlgorithm() const
Get back a pointer to the running algorithm.
MOCK_METHOD0(cancelRunningAlgorithm, void())
MOCK_CONST_METHOD0(getAlgorithm, Mantid::API::IAlgorithm_sptr())
MOCK_METHOD1(startAlgorithmImpl, void(Mantid::API::IAlgorithm_sptr))
void startAlgorithm(Mantid::API::IAlgorithm_sptr alg)
Begin asynchronous execution of an algorithm and observe its execution.
Mantid::API::IAlgorithm_sptr algorithm() const
MockAlgorithmRunner()=default
Mantid::API::IAlgorithm_sptr m_algorithm
std::shared_ptr< IAlgorithm > IAlgorithm_sptr
shared pointer to Mantid::API::IAlgorithm