Skip to content
Snippets Groups Projects
EnvironmentHistoryTest.h 1.34 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 {
  void testframeworkVersion() {
    TS_ASSERT_EQUALS(EH.frameworkVersion(), MantidVersion::version());
  void testosName() {
    TS_ASSERT_EQUALS(EH.osName(), ConfigService::Instance().getOSName());
  }
  void testosVersion() {
    TS_ASSERT_EQUALS(EH.osVersion(), ConfigService::Instance().getOSVersion());

  void testPopulate() {
    std::string correctOutput =
        "Framework Version: " + std::string(MantidVersion::version()) + "\n";
    correctOutput += "OS name: " + ConfigService::Instance().getOSName() + "\n";
    correctOutput +=
        "OS version: " + ConfigService::Instance().getOSVersion() + "\n";
    // dump output to sting
    output.exceptions(std::ios::failbit | std::ios::badbit);
    TS_ASSERT_EQUALS(output.str(), correctOutput);