Example #1
0
        public void Conjoining()
        {
            var prog1 = ReadStaticMethod(() => Mooo());
            var prog2 = ReadStaticMethod(() => Plop());

            var conjoined = new LinkedList <Instruction>(prog1.Concat(prog2));

            _output.WriteLine(OpPrinter.Print(conjoined));
        }
Example #2
0
        public void Pointless1()
        {
            var type   = typeof(UnitTest1);
            var method = type.GetMethod("Plop", BindingFlags.Static | BindingFlags.NonPublic).GetMethodBody();

            var els = Reader.Read(type.Module, method, method.GetILAsByteArray());

            _output.WriteLine(OpPrinter.Print(els));
        }
Example #3
0
        public void Regen_WithLocal()
        {
            var prog = ReadStaticMethod(() => ParpyParpParp());

            _output.WriteLine(OpPrinter.Print(prog));

            var generated = Generator.Generate(prog);

            generated.Invoke(null, new object[0]);
        }
Example #4
0
        public void Regen_LocalStaticMethods()
        {
            var prog = ReadStaticMethod(() => CallsLocalStaticMethod());

            _output.WriteLine(OpPrinter.Print(prog));

            Verifier.Verify(prog);

            var generated = Generator.Generate(prog);

            generated.Invoke(null, new object[0]);
        }