unittests/tests/mockSerializer.js
branchpopcorn-port
changeset 182 5fc357f62af1
parent 140 1f90756342e2
equal deleted inserted replaced
181:765eaf72d547 182:5fc357f62af1
     9       ok(ser._data, "the mock data is defined");
     9       ok(ser._data, "the mock data is defined");
    10   });
    10   });
    11   
    11   
    12   test("check that the serialize and deserialize abstract functions are defined", function() {
    12   test("check that the serialize and deserialize abstract functions are defined", function() {
    13       var dt = new IriSP.DataLoader();
    13       var dt = new IriSP.DataLoader();
    14       var ser = new IriSP.Serializer(dt);
    14       var ser = new IriSP.MockSerializer(dt);
    15       notEqual(ser.serialize, undefined, ".serialize is defined");
    15       notEqual(ser.serialize, undefined, ".serialize is defined");
    16       notEqual(ser.deserialize, undefined, ".deserialize is defined");
    16       notEqual(ser.deserialize, undefined, ".deserialize is defined");
    17   });
    17   });
    18   
    18   
    19   test("check that the callback is called", function() {
    19   test("check that the callback is called", function() {
    20       var dt = new IriSP.DataLoader();
    20       var dt = new IriSP.DataLoader();
    21       var ser = new IriSP.Serializer(dt);
    21       var ser = new IriSP.MockSerializer(dt);
    22       var spy = this.spy();
    22       var spy = this.spy();
    23       ser.sync(spy);
    23       ser.sync(spy);
    24       ok(spy.called, "the callback has been called");
    24       ok(spy.called, "the callback has been called");
    25   });
    25   });
    26 
    26