예제 #1
0
 public void BasicClass()
 {
     var test = new ClassDeclaration("TestClass");
     var expected =
     @"class TestClass
     {
     };";
     Assert.AreEqual(expected, test.CreateSource());
 }
예제 #2
0
        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());
        }
예제 #3
0
        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());
        }