Skip to content

Commit 1be816f

Browse files
committed
Add unit test for calling subscriber method
1 parent 2b20c52 commit 1be816f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

qt/scientific_interfaces/Muon/test/ALCDataLoadingPresenterTest.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include "MantidAPI/FrameworkManager.h"
1313
#include "MantidAPI/MatrixWorkspace.h"
14+
#include "MantidFrameworkTestHelpers/WorkspaceCreationHelper.h"
1415
#include "MantidKernel/WarningSuppressions.h"
1516

1617
#include "../Muon/ALCDataLoadingModel.h"
@@ -217,6 +218,15 @@ class ALCDataLoadingPresenterTest : public CxxTest::TestSuite {
217218
"Cannot load an empty workspace");
218219
}
219220

221+
void test_setData_notifies_the_subscriber() {
222+
const MatrixWorkspace_sptr workspace = WorkspaceCreationHelper::create2DWorkspace(1, 5);
223+
224+
EXPECT_CALL(*m_view, setDataCurve(workspace, 0u)).Times(1);
225+
EXPECT_CALL(*m_subscriber, loadedDataChanged()).Times(1);
226+
227+
m_presenter->setData(workspace);
228+
}
229+
220230
void test_defaultLoad() {
221231
InSequence s;
222232

0 commit comments

Comments
 (0)