Exemple #1
0
        public void Test1()
        {
            var         proxier     = new Proxier <TestAbstact>();
            var         func        = proxier.GetCreator <TestAbstact>();
            TestAbstact testAbstact = func();

            Assert.Equal(0, testAbstact.Get("0"));
        }
Exemple #2
0
        public void Test1()
        {
            NatashaInitializer.InitializeAndPreheating();
            var         proxier     = new Proxier <TestAbstact>();
            var         func        = proxier.GetDefaultCreator <TestAbstact>();
            TestAbstact testAbstact = func();

            Assert.Equal(0, testAbstact.Get("0"));
        }
Exemple #3
0
        public void Test()
        {
            var proxier = new Proxier <TestAbstact>();

            proxier["Get"] = "return value.Length;";
            var         func        = proxier.GetCreator <TestAbstact>();
            TestAbstact testAbstact = func();

            Assert.Equal(1, testAbstact.Get("1"));
        }
Exemple #4
0
        public void Test()
        {
            NatashaInitializer.InitializeAndPreheating();
            var proxier = new Proxier <TestAbstact>();

            proxier["Get"] = "return value.Length;";
            var         func        = proxier.GetDefaultCreator <TestAbstact>();
            TestAbstact testAbstact = func();

            Assert.Equal(1, testAbstact.Get("1"));
        }
Exemple #5
0
        public void Test9()
        {
            NatashaInitializer.InitializeAndPreheating();
            var proxier = new Proxier <TestAbstact>();

            proxier.ClassBuilder.Ctor(ctor => ctor
                                      .Public()
                                      .Param <int>("value")
                                      .Body("_value = value;")
                                      );
            proxier.ClassBuilder.PrivateReadonlyField <int>("_value");
            proxier["Get"] = "return _value;";
            var         func        = proxier.GetCreator <int>();
            TestAbstact testAbstact = func(10);

            Assert.Equal(10, testAbstact.Get("1"));
        }