public void BasicClass() { var test = new ClassDeclaration("TestClass"); var expected = @"class TestClass { };"; Assert.AreEqual(expected, test.CreateSource()); }
public void MemberFunction() { var test = new ClassDeclaration("TestClass"); test.Functions.Add(new FunctionDeclaration("DoSomething", Primitive.Char.MakePointer().MakeConst(), AccessLevel.Public)); var expected = @"class TestClass { public: const char *DoSomething(); };"; Assert.AreEqual(expected, test.CreateSource()); }
public void MemberField() { var test = new ClassDeclaration("TestClass"); test.Fields.Add(new FieldDeclaration("m_someInt", Primitive.Int, AccessLevel.Private)); var expected = @"class TestClass { private: int m_someInt; };"; Assert.AreEqual(expected, test.CreateSource()); }