示例#1
0
    def test_type(self):
        '''Test types of some of the objects'''
        obj = dotnet.DotNetNamespace({'id': 'Foo.Bar'})
        self.assertEqual(obj.type, 'namespace')
        self.assertEqual(obj.ref_type, 'namespace')
        self.assertEqual(obj.ref_directive, 'ns')

        obj = dotnet.DotNetMethod({'id': 'Foo.Bar'})
        self.assertEqual(obj.type, 'method')
        self.assertEqual(obj.ref_type, 'method')
        self.assertEqual(obj.ref_directive, 'meth')

        obj = dotnet.DotNetProperty({'id': 'Foo.Bar'})
        self.assertEqual(obj.type, 'property')
        self.assertEqual(obj.ref_type, 'property')
        self.assertEqual(obj.ref_directive, 'prop')

        obj = dotnet.DotNetEnum({'id': 'Foo.Bar'})
        self.assertEqual(obj.type, 'enum')
        self.assertEqual(obj.ref_type, 'enumeration')
        self.assertEqual(obj.ref_directive, 'enum')

        obj = dotnet.DotNetStruct({'id': 'Foo.Bar'})
        self.assertEqual(obj.type, 'struct')
        self.assertEqual(obj.ref_type, 'structure')
        self.assertEqual(obj.ref_directive, 'struct')

        obj = dotnet.DotNetConstructor({'id': 'Foo.Bar'})
        self.assertEqual(obj.type, 'constructor')
        self.assertEqual(obj.ref_type, 'constructor')
        self.assertEqual(obj.ref_directive, 'ctor')

        obj = dotnet.DotNetInterface({'id': 'Foo.Bar'})
        self.assertEqual(obj.type, 'interface')
        self.assertEqual(obj.ref_type, 'interface')
        self.assertEqual(obj.ref_directive, 'iface')

        obj = dotnet.DotNetDelegate({'id': 'Foo.Bar'})
        self.assertEqual(obj.type, 'delegate')
        self.assertEqual(obj.ref_type, 'delegate')
        self.assertEqual(obj.ref_directive, 'del')

        obj = dotnet.DotNetClass({'id': 'Foo.Bar'})
        self.assertEqual(obj.type, 'class')
        self.assertEqual(obj.ref_type, 'class')
        self.assertEqual(obj.ref_directive, 'cls')

        obj = dotnet.DotNetField({'id': 'Foo.Bar'})
        self.assertEqual(obj.type, 'field')
        self.assertEqual(obj.ref_type, 'field')
        self.assertEqual(obj.ref_directive, 'field')

        obj = dotnet.DotNetEvent({'id': 'Foo.Bar'})
        self.assertEqual(obj.type, 'event')
        self.assertEqual(obj.ref_type, 'event')
        self.assertEqual(obj.ref_directive, 'event')
示例#2
0
    def test_type(self):
        """Test types of some of the objects"""
        obj = dotnet.DotNetNamespace({"id": "Foo.Bar"}, jinja_env=None)
        self.assertEqual(obj.type, "namespace")
        self.assertEqual(obj.ref_type, "namespace")
        self.assertEqual(obj.ref_directive, "ns")

        obj = dotnet.DotNetMethod({"id": "Foo.Bar"}, jinja_env=None)
        self.assertEqual(obj.type, "method")
        self.assertEqual(obj.ref_type, "method")
        self.assertEqual(obj.ref_directive, "meth")

        obj = dotnet.DotNetProperty({"id": "Foo.Bar"}, jinja_env=None)
        self.assertEqual(obj.type, "property")
        self.assertEqual(obj.ref_type, "property")
        self.assertEqual(obj.ref_directive, "prop")

        obj = dotnet.DotNetEnum({"id": "Foo.Bar"}, jinja_env=None)
        self.assertEqual(obj.type, "enum")
        self.assertEqual(obj.ref_type, "enumeration")
        self.assertEqual(obj.ref_directive, "enum")

        obj = dotnet.DotNetStruct({"id": "Foo.Bar"}, jinja_env=None)
        self.assertEqual(obj.type, "struct")
        self.assertEqual(obj.ref_type, "structure")
        self.assertEqual(obj.ref_directive, "struct")

        obj = dotnet.DotNetConstructor({"id": "Foo.Bar"}, jinja_env=None)
        self.assertEqual(obj.type, "constructor")
        self.assertEqual(obj.ref_type, "constructor")
        self.assertEqual(obj.ref_directive, "ctor")

        obj = dotnet.DotNetInterface({"id": "Foo.Bar"}, jinja_env=None)
        self.assertEqual(obj.type, "interface")
        self.assertEqual(obj.ref_type, "interface")
        self.assertEqual(obj.ref_directive, "iface")

        obj = dotnet.DotNetDelegate({"id": "Foo.Bar"}, jinja_env=None)
        self.assertEqual(obj.type, "delegate")
        self.assertEqual(obj.ref_type, "delegate")
        self.assertEqual(obj.ref_directive, "del")

        obj = dotnet.DotNetClass({"id": "Foo.Bar"}, jinja_env=None)
        self.assertEqual(obj.type, "class")
        self.assertEqual(obj.ref_type, "class")
        self.assertEqual(obj.ref_directive, "cls")

        obj = dotnet.DotNetField({"id": "Foo.Bar"}, jinja_env=None)
        self.assertEqual(obj.type, "field")
        self.assertEqual(obj.ref_type, "field")
        self.assertEqual(obj.ref_directive, "field")

        obj = dotnet.DotNetEvent({"id": "Foo.Bar"}, jinja_env=None)
        self.assertEqual(obj.type, "event")
        self.assertEqual(obj.ref_type, "event")
        self.assertEqual(obj.ref_directive, "event")
示例#3
0
    def test_type(self):
        """Test types of some of the objects"""
        obj = dotnet.DotNetNamespace({"id": "Foo.Bar"},
                                     jinja_env=None,
                                     app=None)
        assert obj.type == "namespace"
        assert obj.ref_type == "namespace"
        assert obj.ref_directive == "ns"

        obj = dotnet.DotNetMethod({"id": "Foo.Bar"}, jinja_env=None, app=None)
        assert obj.type == "method"
        assert obj.ref_type == "method"
        assert obj.ref_directive == "meth"

        obj = dotnet.DotNetProperty({"id": "Foo.Bar"},
                                    jinja_env=None,
                                    app=None)
        assert obj.type == "property"
        assert obj.ref_type == "property"
        assert obj.ref_directive == "prop"

        obj = dotnet.DotNetEnum({"id": "Foo.Bar"}, jinja_env=None, app=None)
        assert obj.type == "enum"
        assert obj.ref_type == "enumeration"
        assert obj.ref_directive == "enum"

        obj = dotnet.DotNetStruct({"id": "Foo.Bar"}, jinja_env=None, app=None)
        assert obj.type == "struct"
        assert obj.ref_type == "structure"
        assert obj.ref_directive == "struct"

        obj = dotnet.DotNetConstructor({"id": "Foo.Bar"},
                                       jinja_env=None,
                                       app=None)
        assert obj.type == "constructor"
        assert obj.ref_type == "constructor"
        assert obj.ref_directive == "ctor"

        obj = dotnet.DotNetInterface({"id": "Foo.Bar"},
                                     jinja_env=None,
                                     app=None)
        assert obj.type == "interface"
        assert obj.ref_type == "interface"
        assert obj.ref_directive == "iface"

        obj = dotnet.DotNetDelegate({"id": "Foo.Bar"},
                                    jinja_env=None,
                                    app=None)
        assert obj.type == "delegate"
        assert obj.ref_type == "delegate"
        assert obj.ref_directive == "del"

        obj = dotnet.DotNetClass({"id": "Foo.Bar"}, jinja_env=None, app=None)
        assert obj.type == "class"
        assert obj.ref_type == "class"
        assert obj.ref_directive == "cls"

        obj = dotnet.DotNetField({"id": "Foo.Bar"}, jinja_env=None, app=None)
        assert obj.type == "field"
        assert obj.ref_type == "field"
        assert obj.ref_directive == "field"

        obj = dotnet.DotNetEvent({"id": "Foo.Bar"}, jinja_env=None, app=None)
        assert obj.type == "event"
        assert obj.ref_type == "event"
        assert obj.ref_directive == "event"