# -*- coding: utf-8 -*-
"""
Created on Fri Apr 08 11:33:01 2016

@author: Leander Kotzur
"""


import tsib

def test_get_ID():
    # parameterize a building
    bdgcfg = tsib.BuildingConfiguration(
        {
            "refurbishment": False,
            "nightReduction": False,
            "occControl": False,
            "capControl": True,
            "n_persons": 2,
            "roofOrientation": 0.0,
            "n_apartments": 1,
            "latitude": 49.,
            "longitude": 12.,
        }
    )

    bdgObj = tsib.Building(configurator=bdgcfg)
    print('ID is : ' + str(bdgObj.ID))

    return


def test_set_ID():
    # parameterize a building
    bdgcfg = tsib.BuildingConfiguration(
        {
            "buildingYear": 1980,
            "n_persons": 2,
            "roofOrientation": 0.0,
            "n_apartments": 2,
            "a_ref": 300.,
            "surrounding": "Detached",
            "latitude": 52.,
            "longitude": 13.,
        }
    )
    bdgObj = tsib.Building(configurator=bdgcfg)
    
    bdgObj.ID = 'custom'

    if not bdgObj.ID == 'custom':
        raise ValueError()

    return

[((13, 13, 25, 5), 'tsib.BuildingConfiguration', 'tsib.BuildingConfiguration', ({(14, 8, 24, 9): "{'refurbishment': False, 'nightReduction': False, 'occControl': False,\n    'capControl': True, 'n_persons': 2, 'roofOrientation': 0.0,\n    'n_apartments': 1, 'latitude': 49.0, 'longitude': 12.0}"}, {}), "({'refurbishment': False, 'nightReduction': False,\n    'occControl': False, 'capControl': True, 'n_persons': 2,\n    'roofOrientation': 0.0, 'n_apartments': 1, 'latitude': 49.0,\n    'longitude': 12.0})", False, 'import tsib\n'), ((27, 13, 27, 47), 'tsib.Building', 'tsib.Building', (), '', False, 'import tsib\n'), ((35, 13, 46, 5), 'tsib.BuildingConfiguration', 'tsib.BuildingConfiguration', ({(36, 8, 45, 9): "{'buildingYear': 1980, 'n_persons': 2, 'roofOrientation': 0.0,\n    'n_apartments': 2, 'a_ref': 300.0, 'surrounding': 'Detached',\n    'latitude': 52.0, 'longitude': 13.0}"}, {}), "({'buildingYear': 1980, 'n_persons': 2,\n    'roofOrientation': 0.0, 'n_apartments': 2, 'a_ref': 300.0,\n    'surrounding': 'Detached', 'latitude': 52.0, 'longitude': 13.0})", False, 'import tsib\n'), ((47, 13, 47, 47), 'tsib.Building', 'tsib.Building', (), '', False, 'import tsib\n')]