Class: AddOutputVariable_Test

Inherits:
Minitest::Test
  • Object
show all
Defined in:
lib/measures/Add Output Variable/tests/AddOutputVariable_Test.rb

Instance Method Summary collapse

Instance Method Details

#test_AddOutputVariable_GoodInputObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/measures/Add Output Variable/tests/AddOutputVariable_Test.rb', line 14

def test_AddOutputVariable_GoodInput
  # create an instance of the measure
  measure = AddOutputVariable.new

  # create an instance of a runner
  runner = OpenStudio::Measure::OSRunner.new(OpenStudio::WorkflowJSON.new)

  # make an empty model
  model = OpenStudio::Model::Model.new

  # get arguments and test that they are what we are expecting
  arguments = measure.arguments(model)

  # set argument values to good values and run the measure on model with spaces
  argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments)
  variable_name = arguments[0].clone
  assert(variable_name.setValue('JustATest'))
  argument_map['variable_name'] = variable_name
  reporting_frequency = arguments[1].clone
  assert(reporting_frequency.setValue('hourly'))
  argument_map['reporting_frequency'] = reporting_frequency
  key_value = arguments[2].clone
  assert(key_value.setValue('Test'))
  argument_map['key_value'] = key_value
  measure.run(model, runner, argument_map)
  result = runner.result
  show_output(result)
  assert(result.value.valueName == 'Success')
  assert(result.warnings.empty?)
  # assert(result.info.size == 1)
end