"use strict";

describe('Entry.EntryObject', function(){
    it('exist', function(){
        assert.equal(typeof Entry.EntryObject, "function");
    })

    describe('getter & setter', function(){
        it('exist', function(){
            var model = new Entry.EntryObject();

            assert.equal(typeof model.get, "function");
            assert.equal(typeof model.set, "function");
        })

        it('test', function(){
            var model = new Entry.EntryObject();

            var value = Math.random();

            model.set({
                key: value
            });
            assert.equal(
                value,
                model.get('key')
            );
        })
    });

    describe('schema', function(){
        it('test', function(){
            var model = new Entry.EntryObject();

            assert.isTrue(
                model.data.hasOwnProperty('name')
            );

            assert.isFalse(
                model.data.hasOwnProperty('Id')
            );
        })
    });

    describe('bind', function() {
        it('exist', function(){
            var model = new Entry.EntryObject();

            assert.equal(typeof model.bind, "function");
            assert.equal(typeof model.unbind, "function");
        });

        it('register', function() {
            var testObject = {};
            var model = new Entry.EntryObject();

            assert.isFalse(model.unbind(testObject));
            model.bind(testObject);
            assert.isTrue(model.unbind(testObject));
            assert.isFalse(model.unbind(testObject));
        });
    });

    describe('observer fire', function() {
        it('test', function(done) {
            var testObject = {
                update: function() {
                    done();
                }
            };
            var model = new Entry.EntryObject();

            model.bind(testObject);
            model.notify();
        });

    });
});

@@ -829,30 +829,381 @@
         
-assert.isTrue(
+var schema = %7B%0A                id: null,%0A                name: null,%0A                order: null,%0A                objectType: null,%0A                scene: null,%0A                lock: null,%0A                rotateMethod: null,%0A                entity: null,%0A                script: null,%0A                sprite: null%0A            %7D;%0A%0A            for (var key in schema)
 %0A       
@@ -1203,32 +1203,46 @@
                 
+assert.isTrue(
 model.data.hasOw
@@ -1255,28 +1255,12 @@
 rty(
-'name')%0A            
+key)
 );%0A%0A

add schema test