From 7a4cefb04619f9ed8613ce709ac2bc96b804c91b Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Wed, 18 Feb 2015 15:01:14 +0100 Subject: [PATCH] Refs #11104. Adding intensity test for Lorentzian --- .../Framework/CurveFitting/test/LorentzianTest.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Code/Mantid/Framework/CurveFitting/test/LorentzianTest.h b/Code/Mantid/Framework/CurveFitting/test/LorentzianTest.h index 660939553f9b..f9781ce2b345 100644 --- a/Code/Mantid/Framework/CurveFitting/test/LorentzianTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/LorentzianTest.h @@ -103,6 +103,21 @@ class LorentzianTest : public CxxTest::TestSuite TS_ASSERT_EQUALS(y[0], 0.0); } + void testIntensity() + { + Mantid::CurveFitting::Lorentzian lor; + lor.initialize(); + lor.setHeight(2.0); + lor.setCentre(3.0); + lor.setFwhm(1.0); + + TS_ASSERT_DELTA(lor.intensity(), 1.873097930277787, 1e-10); + TS_ASSERT_THROWS_NOTHING(lor.setIntensity(2.0)); + + TS_ASSERT_DELTA(lor.intensity(), 2.0, 1e-10); + TS_ASSERT_EQUALS(lor.fwhm(), 1.0); + } + private: class TestableLorentzian : public Mantid::CurveFitting::Lorentzian