public void TestAstSwitch()
        {
            var argument = AstArgument.Create <int>(0, "Value");
            var ast      = Ast.Statements(
                Ast.Switch(
                    Ast.Argument(argument),
                    Ast.Default(Ast.Return("-")),
                    Ast.Case(1, Ast.Return("One")),
                    Ast.Case(3, Ast.Return("Three"))
                    ),
                Ast.Return("Invalid!")
                );
            var generatorIl = new GeneratorIl();
            var method      = generatorIl.GenerateDelegate <Func <int, string> >("TestSwitch", ast);

            Assert.Equal("-", method(0));
            Assert.Equal("One", method(1));
            Assert.Equal("-", method(2));
            Assert.Equal("Three", method(3));
            Assert.Equal("-", method(4));
        }
        public void TestAstSwitch()
        {
            var Argument = AstArgument.Create <int>(0, "Value");
            var Ast      = ast.Statements(
                ast.Switch(
                    ast.Argument(Argument),
                    ast.Default(ast.Return("-")),
                    ast.Case(1, ast.Return("One")),
                    ast.Case(3, ast.Return("Three"))
                    ),
                ast.Return("Invalid!")
                );
            var GeneratorIL = new GeneratorIL();
            var Method      = GeneratorIL.GenerateDelegate <Func <int, string> >("TestSwitch", Ast);

            Assert.AreEqual("-", Method(0));
            Assert.AreEqual("One", Method(1));
            Assert.AreEqual("-", Method(2));
            Assert.AreEqual("Three", Method(3));
            Assert.AreEqual("-", Method(4));
        }