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()); }
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()); }