Exemplo n.º 1
0
 def test_get_from_template_with_inserted_template_should_succeed(self):
     assert_that(get_classifier_name(
         PlyjType('HashMap',
                  type_arguments=['String',
                                  PlyjType('List',
                                           type_arguments=['int'])])),
                 equal_to('HashMap'))
Exemplo n.º 2
0
 def test_make_array_should_succeed(self):
     variable_decl = VariableDeclarator(Variable('', dimensions=1))
     field = FieldDeclaration(PlyjType('A', dimensions=1), [variable_decl])
     variable_type = VariableType(field, variable_decl.variable)
     classifier = Class('A')
     assert_that(variable_type.type(classifier),
                 equal_to(Type(classifier, lower=0, upper=None)))
     assert_that(variable_type.type_name(), equal_to('A[][]'))
     assert_that(variable_type.classifier_name(), equal_to('A'))
Exemplo n.º 3
0
 def test_get_from_plyj_type_with_add_dimensions_should_succeed(self):
     assert_that(get_type_name(PlyjType('int'), 1), equal_to('int[]'))
Exemplo n.º 4
0
 def test_get_from_plyj_array_type_should_succeed(self):
     assert_that(get_type_name(PlyjType('int', dimensions=1)),
                 equal_to('int[]'))
Exemplo n.º 5
0
 def test_get_from_plyj_type_should_succeed(self):
     assert_that(get_type_name(PlyjType('int')), equal_to('int'))
Exemplo n.º 6
0
 def test_get_from_template_with_two_args_should_succeed(self):
     assert_that(get_type_name(
         PlyjType('HashMap', type_arguments=['String', 'int'])),
         equal_to('HashMap<>'))
Exemplo n.º 7
0
 def test_get_from_template_plyj_type_should_succeed(self):
     assert_that(get_type_name(PlyjType('List', type_arguments=['int'])),
                 equal_to('List<>'))