コード例 #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());
        }
コード例 #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());
        }
コード例 #3
0
 public void Virtual()
 {
     var test = new FunctionDeclaration("DoSomething", Primitive.Void, AccessLevel.Public, true);
     Assert.AreEqual("virtual void DoSomething()", test.CreateSource());
 }
コード例 #4
0
 public void Pointer()
 {
     var test = new FunctionDeclaration("DoSomething", Primitive.Int.MakePointer());
     Assert.AreEqual("int *DoSomething()", test.CreateSource());
 }