Beispiel #1
0
        public void TestCtor3()
        {
            CtorBuilder ctor   = new CtorBuilder();
            string      result = ctor.Name("Test")
                                 .Modifier(Natasha.Reverser.Model.Modifiers.Static)
                                 .Body("this.connection = initString;")
                                 .Script;

            Assert.Equal($"static Test(){{this.connection = initString;}}", result);
        }
Beispiel #2
0
        public void TestCtor2()
        {
            CtorBuilder ctor   = new CtorBuilder();
            string      result = ctor.Name("Test")
                                 .Access(Natasha.Reverser.Model.AccessTypes.Private)
                                 .Body("this.connection = initString;")
                                 .Script;

            Assert.Equal($"private Test(){{this.connection = initString;}}", result);
        }
Beispiel #3
0
        public void TestCtor3()
        {
            CtorBuilder ctor   = new CtorBuilder();
            string      result = ctor.Name("Test")
                                 .MemberModifier(Modifiers.Static)
                                 .Body("this.connection = initString;")
                                 .Script;

            Assert.Equal($"static Test(){{{Environment.NewLine}this.connection = initString;}}", result);
        }
Beispiel #4
0
        public void TestCtor2()
        {
            CtorBuilder ctor   = new CtorBuilder();
            string      result = ctor.Name("Test")
                                 .MemberAccess(AccessTypes.Private)
                                 .Body("this.connection = initString;")
                                 .Script;

            Assert.Equal($"private Test(){{{Environment.NewLine}this.connection = initString;}}", result);
        }
Beispiel #5
0
        public void TestCtor1()
        {
            CtorBuilder ctor   = new CtorBuilder();
            string      result = ctor.Name("Test")
                                 .Access(Natasha.Reverser.Model.AccessTypes.Public)
                                 .Param <string>("initString")
                                 .Body("this.connection = initString;")
                                 .Script;

            Assert.Equal($"public Test(System.String initString){{this.connection = initString;}}", result);
        }
Beispiel #6
0
        public void TestCtor1()
        {
            CtorBuilder ctor   = new CtorBuilder();
            string      result = ctor.Name("Test")
                                 .MemberAccess(AccessTypes.Public)
                                 .Param <string>("initString")
                                 .Body("this.connection = initString;")
                                 .Script;

            Assert.Equal($"public Test(String initString){{{Environment.NewLine}this.connection = initString;}}", result);
        }