Skip to content

Commit

Permalink
refs #4201 missing test added
Browse files Browse the repository at this point in the history
  • Loading branch information
abuts committed Jan 16, 2012
1 parent 0757045 commit 6182de1
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions Code/Mantid/Framework/MDEvents/test/MDWSDescriptionTest.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#ifndef MANTID_MDWS_DESCRIPTION_H_
#define MANTID_MDWS_DESCRIPTION_H_

#include <cxxtest/TestSuite.h>
#include "MantidMDEvents/MDWSDescription.h"


using namespace Mantid::MDEvents;
using namespace Mantid::Kernel;

class MDWSDescriptionTest : public CxxTest::TestSuite
{
MDWSDescription descr;
public:
// This pair of boilerplate methods prevent the suite being created statically
// This means the constructor isn't called when running other tests
static MDWSDescriptionTest *createSuite() { return new MDWSDescriptionTest(); }
static void destroySuite( MDWSDescriptionTest *suite ) { delete suite; }

void test_name()
{
V3D dir1(1,0,0);
std::string name;

TS_ASSERT_THROWS_NOTHING(name=makeAxisName(dir1,descr.defailt_qNames));
TS_ASSERT_EQUALS("[Qh,0,0]",name);

TS_ASSERT_THROWS_NOTHING(name=makeAxisName(V3D(-1,0.99,-1.001),descr.defailt_qNames));
TS_ASSERT_EQUALS("[-Qh,0.99Qk,-Ql]",name);

TS_ASSERT_THROWS_NOTHING(name=makeAxisName(V3D(-1,0.9999,-1.001),descr.defailt_qNames));
TS_ASSERT_EQUALS("[-Qh,Qk,-Ql]",name);

TS_ASSERT_THROWS_NOTHING(name=makeAxisName(V3D(-1,0.999,-1.01),descr.defailt_qNames));
TS_ASSERT_EQUALS("[-Qh,0.999Qk,-1.01Ql]",name);

TS_ASSERT_THROWS_NOTHING(name=makeAxisName(V3D(2.01,0.9,-1.01),descr.defailt_qNames));
TS_ASSERT_EQUALS("[2.01Qh,0.9Qk,-1.01Ql]",name);



}

MDWSDescriptionTest::MDWSDescriptionTest():descr(5)
{
}

};


#endif

0 comments on commit 6182de1

Please sign in to comment.