def test_snippet_prefix_equals_objectname(self, objectname_html_file): snippet = Function(objectname_html_file).to_snippet() assert snippet['prefix'] == 'ObjectName()'
def test_snippet_body_of_barscalculated(self, barscalculated_html_file): snippet = Function(barscalculated_html_file).to_snippet() assert snippet['body'] == ["BarsCalculated(${1:int indicator_handle})$0"]
def test_snippet_prefix_equals_barscalculated(self, barscalculated_html_file): snippet = Function(barscalculated_html_file).to_snippet() assert snippet['prefix'] == 'BarsCalculated()'
def test_snippet_prefix_equals_chartsymbol(self, chartsymbol_html_file): snippet = Function(chartsymbol_html_file).to_snippet() assert snippet['prefix'] == 'ChartSymbol()'
def test_function_name_equals_chartsymbol(self, chartsymbol_html_file): function = Function(chartsymbol_html_file) assert function.name == 'ChartSymbol'
def test_function_parameters_item_3_of_objectname(self, objectname_html_file): function = Function(objectname_html_file) parameter = Parameter('type=-1', 'int') assert function.parameters[3] == parameter
def test_function_parameters_item_0_of_objectname(self, objectname_html_file): function = Function(objectname_html_file) parameter = Parameter('chart_id', 'long') assert function.parameters[0] == parameter
def test_snippet_description_of_chartsymbol(self, chartsymbol_html_file): snippet = Function(chartsymbol_html_file).to_snippet() assert snippet['description'] == "ChartSymbol() function"
def test_function_parameters_len_equals_4(self, objectname_html_file): function = Function(objectname_html_file) assert len(function.parameters) == 4
def test_function_parameters_item_0_of_barscalculated(self, barscalculated_html_file): function = Function(barscalculated_html_file) parameter = Parameter('indicator_handle', 'int') assert function.parameters[0] == parameter
def test_function_parameters_len_equals_1(self, barscalculated_html_file): function = Function(barscalculated_html_file) assert len(function.parameters) == 1
def test_function_type_equals_string(self, chartsymbol_html_file): function = Function(chartsymbol_html_file) assert function.type == 'string'
def test_function_type_equals_int(self, barscalculated_html_file): function = Function(barscalculated_html_file) assert function.type == 'int'
def test_snippet_body_of_chartsymbol(self, chartsymbol_html_file): snippet = Function(chartsymbol_html_file).to_snippet() assert snippet['body'] == ["ChartSymbol(${1:long chart_id=0})$0"]
def test_function_parameters_item_1_of_objectname(self, objectname_html_file): function = Function(objectname_html_file) parameter = Parameter('pos', 'int') assert function.parameters[1] == parameter
def test_snippet_description_of_barscalculated(self, barscalculated_html_file): snippet = Function(barscalculated_html_file).to_snippet() assert snippet['description'] == "BarsCalculated() function"
def test_function_parameters_item_2_of_objectname(self, objectname_html_file): function = Function(objectname_html_file) parameter = Parameter('sub_window=-1', 'int') assert function.parameters[2] == parameter
def test_snippet_description_of_objectname(self, objectname_html_file): snippet = Function(objectname_html_file).to_snippet() assert snippet['description'] == "ObjectName() function"
def test_function_name_equals_barscalculated(self, barscalculated_html_file): function = Function(barscalculated_html_file) assert function.name == 'BarsCalculated'