Skip to content

Commit

Permalink
Add initial testing class
Browse files Browse the repository at this point in the history
  • Loading branch information
cailafinn committed May 2, 2024
1 parent 74c3fff commit 08db204
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
1 change: 1 addition & 0 deletions Framework/Algorithms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,7 @@ set(TEST_FILES
PolarizationCorrections/HeliumAnalyserEfficiencyTest.h
PolarizationCorrections/PolarizationCorrectionsHelpersTest.h
PolarizationCorrections/SpinStateValidatorTest.h
PolarizationCorrections/FlipperEfficiencyTest.h
PolarizationCorrectionFredrikzeTest.h
PolarizationCorrectionWildesTest.h
PolarizationEfficiencyCorTest.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ using namespace Kernel;
// Register the algorithm in the AlgorithmFactory
DECLARE_ALGORITHM(FlipperEfficiency)

std::string const FlipperEfficiency::summary() const {}
std::string const FlipperEfficiency::summary() const { return "Calculate the efficiency of the polarization flipper."; }

void FlipperEfficiency::init() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ class DepolarizedAnalyserTransmissionTest : public CxxTest::TestSuite {
TS_ASSERT_THROWS_EQUALS(alg->execute(), std::runtime_error const &e, std::string(e.what()),
"Failed to fit to transmission workspace, : Fit quality (chi-squared) is too poor "
"(0.000000. Should be 0 < x < 1). You may want to check that the correct spectrum "

"and starting fitting values were provided.");
TS_ASSERT(!alg->isExecuted());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright &copy; 2024 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#pragma once

#include <cxxtest/TestSuite.h>

#include "MantidAlgorithms/CreateSampleWorkspace.h"
#include "MantidAlgorithms/PolarizationCorrections/FlipperEfficiency.h"

namespace {} // namespace

using Mantid::Algorithms::FlipperEfficiency;

class FlipperEfficiencyTest : public CxxTest::TestSuite {
public:
void test_name() {
FlipperEfficiency const alg;
TS_ASSERT_EQUALS(alg.name(), "FlipperEfficiency");
}

void test_version() {
FlipperEfficiency const alg;
TS_ASSERT_EQUALS(alg.version(), 1);
}

void test_category() {
FlipperEfficiency const alg;
TS_ASSERT_EQUALS(alg.category(), "SANS\\PolarizationCorrections");
}
};

0 comments on commit 08db204

Please sign in to comment.