"README.md" did not exist on "207fac3a356f65b0194e91d5aa8d3a9437206b3d"
Newer
Older
Russell Taylor
committed
#ifndef ENVIRONMENTHISTORYTEST_H_
#define ENVIRONMENTHISTORYTEST_H_
#include <cxxtest/TestSuite.h>
#include "MantidKernel/EnvironmentHistory.h"
#include "MantidKernel/ConfigService.h"
#include "MantidKernel/MantidVersion.h"
Russell Taylor
committed
#include <sstream>
Russell Taylor
committed
class EnvironmentHistoryTest : public CxxTest::TestSuite
{
public:
{
EnvironmentHistory EH;
TS_ASSERT_EQUALS(EH.frameworkVersion(),MANTID_VERSION);
}
void testosName()
{
EnvironmentHistory EH;
TS_ASSERT_EQUALS(EH.osName(),ConfigService::Instance().getOSName());
}
void testosVersion()
{
EnvironmentHistory EH;
TS_ASSERT_EQUALS(EH.osVersion(),ConfigService::Instance().getOSVersion());
}
Russell Taylor
committed
{
std::string correctOutput = "Framework Version: "+std::string(MANTID_VERSION)+"\n";
correctOutput = correctOutput + "OS name: " + ConfigService::Instance().getOSName() + "\n";
correctOutput = correctOutput + "OS version: " + ConfigService::Instance().getOSVersion() + "\n";
Russell Taylor
committed
correctOutput = correctOutput + "username: \n";
// Not really much to test
EnvironmentHistory EH;
//dump output to sting
std::ostringstream output;
output.exceptions( std::ios::failbit | std::ios::badbit );
TS_ASSERT_THROWS_NOTHING(output << EH);
TS_ASSERT_EQUALS(output.str(),correctOutput);
}
};
#endif /* ALGORITHMPARAMETERTEST_H_*/