Ejemplo n.º 1
0
        public void ConstructorFromAssemblyArr()
        {
            const string memberSignature      = "Void .ctor(System.String, Byte[])";
            const string expectedMemberName   = "ctor_string_byteArray";
            var          actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }
Ejemplo n.º 2
0
        public void FunctionArrayArgument()
        {
            const string memberSignature      = "public void Fun(float[] args)";
            const string expectedMemberName   = "Fun_floatArray";
            var          actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }
Ejemplo n.º 3
0
        public void ConstructorFromAssemblyNoArgs()
        {
            const string memberSignature      = "Void .ctor()";
            const string expectedMemberName   = "ctor";
            var          actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }
Ejemplo n.º 4
0
        public void ConstructorWithObjectArray()
        {
            const string memberSignature      = "public AndroidJavaObject(string className, params object[] args)";
            const string expectedMemberName   = "ctor_string_objectArray";
            var          actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }
Ejemplo n.º 5
0
        public void BasicFunctionNoArgsExtraSpace()
        {
            const string memberSignature      = "Touch GetSecondaryTouch ( )";
            const string expectedMemberName   = "GetSecondaryTouch";
            var          actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }
Ejemplo n.º 6
0
        public void ConstructorFromTxt3ArgsSimplified()
        {
            const string memberSignature      = "Vector3(float a, float b, float c)";
            const string expectedMemberName   = "ctor";
            var          actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature, true);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }
Ejemplo n.º 7
0
        public void GenericFunction()
        {
            const string memberSignature      = "FieldType Get<FieldType>(string fieldName)";
            const string expectedMemberName   = "Get_FieldType__string";
            var          actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }
Ejemplo n.º 8
0
        public void FunctionWith3DArray()
        {
            const string memberSignature      = "void SetAlphaMaps (int x, int y, float[,,] map)";
            const string expectedMemberName   = "SetAlphaMaps_int_int_floatArray";
            var          actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }
Ejemplo n.º 9
0
        public void ReducePrimitivesObjectArray()
        {
            const string memberSignature      = "Touch GetSecondaryTouch (Object[] arr)";
            const string expectedMemberName   = "GetSecondaryTouch_objectArray";
            var          actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }
Ejemplo n.º 10
0
        public void ReducePrimitivesByte()
        {
            const string memberSignature      = "Touch GetSecondaryTouch (System.Byte)";
            const string expectedMemberName   = "GetSecondaryTouch_byte";
            var          actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }
Ejemplo n.º 11
0
        public void ReducePrimitivesUnityEngineObject()
        {
            const string memberSignature      = "Object GetSecondaryTouch (UnityEngine.Object index)";
            const string expectedMemberName   = "GetSecondaryTouch_object";
            var          actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }
Ejemplo n.º 12
0
        public void ReducePrimitivesInt32()
        {
            const string memberSignature      = "Touch GetSecondaryTouch (Int32 index)";
            const string expectedMemberName   = "GetSecondaryTouch_int";
            var          actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }
Ejemplo n.º 13
0
        public void ConstructorFromAssemblyComplicated()
        {
            const string memberSignature      = "Void .ctor(System.String, System.String, UnityEngine.Texture2D, System.String, System.String, Boolean, Int32)";
            const string expectedMemberName   = "ctor_string_string_Texture2D_string_string_bool_int";
            var          actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }
Ejemplo n.º 14
0
        public void SimpleArgumentWithoutParam()
        {
            const string memberSignature      = "public void Fun(float)";
            const string expectedMemberName   = "Fun_float";
            var          actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }
Ejemplo n.º 15
0
        public void SimpleDelegate()
        {
            const string memberSignature      = "public delegate void AndroidJavaRunnable();";
            const string expectedMemberName   = "AndroidJavaRunnable";
            var          actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }
Ejemplo n.º 16
0
        public void FunctionWith2DArray()
        {
            const string memberSignature      = "void SetHeights (int xBase, int yBase, float[,] heights)";
            const string expectedMemberName   = "SetHeights_int_int_floatArray";
            var          actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }
Ejemplo n.º 17
0
        public void NameWithTab()
        {
            const string codeContent        = "void					RemoveStateMachine(StateMachine	stateMachine)";
            var          memberName         = MemberNameGenerator.GetMemberNameFromPureSignature(codeContent);
            const string expectedMemberName = "RemoveStateMachine_StateMachine";

            Assert.AreEqual(expectedMemberName, memberName);
        }
Ejemplo n.º 18
0
        public void FunctionWithObjectArrayAndInitizer()
        {
            const string memberSignature      = "public bool Foo(string className, params object[] args) : this()";
            const string expectedMemberName   = "Foo_string_objectArray";
            var          actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }
Ejemplo n.º 19
0
        public void BasicFunctionRefOutParams()
        {
            const string memberSignature      = "static Touch GetSecondaryTouch (ref int index, out float f)";
            const string expectedMemberName   = "GetSecondaryTouch_int_float";
            var          actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }
Ejemplo n.º 20
0
        public void DestructorFromTxtNoArgs()
        {
            const string memberSignature      = "~Vector3()";
            const string expectedMemberName   = "dtor";
            var          actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }
Ejemplo n.º 21
0
        public void SimplePropertyLowercase()
        {
            const string memberSignature      = "static int touchCountSecondary";
            const string expectedMemberName   = "_touchCountSecondary";
            var          actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }
Ejemplo n.º 22
0
        public void BasicFunctionNoModifiers()
        {
            const string memberSignature      = "Touch GetSecondaryTouch (int index)";
            const string expectedMemberName   = "GetSecondaryTouch_int";
            var          actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }
Ejemplo n.º 23
0
        public void FunctionWithObjectArraySimple()
        {
            const string memberSignature      = "public void Foo(string className, params object[] args)";
            const string expectedMemberName   = "Foo";
            var          actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature, true);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }
Ejemplo n.º 24
0
        public void VerifyMemberAndSignatureName(string inputSignature, string expectedMemberName, string expectedSignatureName)
        {
            var actualMemberName    = MemberNameGenerator.GetMemberNameFromPureSignature(inputSignature);
            var actualSignatureName = MemberNameGenerator.GetSignatureFromPureSignature(inputSignature);

            Assert.AreEqual(expectedMemberName, actualMemberName);
            Assert.AreEqual(expectedSignatureName, actualSignatureName);
        }
Ejemplo n.º 25
0
        public void ConstructorFromAssemblyReduceArgs()
        {
            const string memberSignature      = "Void .ctor(String, Boolean, System.Int32)";
            const string expectedMemberName   = "ctor_string_bool_int";
            var          actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }
Ejemplo n.º 26
0
        private void VerifySignature(string memberSignature, string expectedMemberName)
        {
            var actualMemberFileName = MemberNameGenerator.GetMemberNameFromPureSignature(memberSignature);

            Assert.AreEqual(expectedMemberName, actualMemberFileName);
        }