Skip to content
Snippets Groups Projects
EnvironmentHistoryTest.h 1.37 KiB
Newer Older
#ifndef ENVIRONMENTHISTORYTEST_H_
#define ENVIRONMENTHISTORYTEST_H_

#include <cxxtest/TestSuite.h>
#include "MantidKernel/EnvironmentHistory.h"
#include "MantidKernel/ConfigService.h"
#include "MantidKernel/MantidVersion.h"
Nick Draper's avatar
Nick Draper committed
using namespace Mantid::Kernel;

class EnvironmentHistoryTest : public CxxTest::TestSuite
{
public:

Nick Draper's avatar
Nick Draper committed
 void xtestframeworkVersion()
Sofia Antony's avatar
Sofia Antony committed
 {
	 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());
 }
  
Nick Draper's avatar
Nick Draper committed
  void xtestPopulate()
Nick Draper's avatar
Nick Draper 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";
    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_*/