Ejemplo n.º 1
0
        public void Void_OneArg()
        {
            var test = new FunctionDeclaration("DoSomething", Primitive.Void, AccessLevel.Public, false,
                new VariableDeclaration("myInt", Primitive.Int));

            Assert.AreEqual("void DoSomething(int myInt)", test.CreateSource());
        }
Ejemplo n.º 2
0
        public void Void_TwoArgs()
        {
            var test = new FunctionDeclaration("DoSomething", Primitive.Void, AccessLevel.Public, false,
                new VariableDeclaration("myInt", Primitive.Int),
                new VariableDeclaration("someText", Primitive.Char.MakePointer().MakeConst()));

            Assert.AreEqual("void DoSomething(int myInt, const char *someText)", test.CreateSource());
        }
 public void Virtual()
 {
     var test = new FunctionDeclaration("DoSomething", Primitive.Void, AccessLevel.Public, true);
     Assert.AreEqual("virtual void DoSomething()", test.CreateSource());
 }
 public void Pointer()
 {
     var test = new FunctionDeclaration("DoSomething", Primitive.Int.MakePointer());
     Assert.AreEqual("int *DoSomething()", test.CreateSource());
 }