unittests/tests/serializer.js
branchpopcorn-port
changeset 83 1fb63a1a8ac3
parent 65 6a8cae20f190
child 185 2ccec6201261
equal deleted inserted replaced
82:b9a26940e7cc 83:1fb63a1a8ac3
     1 function test_serializer() {
     1 function test_serializer() {
     2   module("Serializer basic tests");
     2   module("Serializer basic tests", {setup: function() {
       
     3     this.dt = new IriSP.DataLoader();
       
     4     this.ser = new IriSP.Serializer(this.dt, "http://google.com");
       
     5   }});
     3   
     6   
     4   test("init the serializer with a DataLoader and an url", function() {
     7   test("init the serializer with a DataLoader and an url", function() {
     5       var dt = new IriSP.DataLoader();
     8       
     6       var ser = new IriSP.Serializer(dt, "http://google.com");
     9       equal( this.ser._DataLoader, this.dt, "The dataloader reference is copied to the object." );
     7       equal( ser._DataLoader, dt, "The dataloader reference is copied to the object." );
    10       equal( this.ser._url, "http://google.com", "The url has been copied as well." );
     8       equal( ser._url, "http://google.com", "The url has been copied as well." );
    11       equal( this.ser._data, undefined, "The serializer data is not defined." );
     9   });
    12   });
    10   
    13   
    11   test("check that the serialize and deserialize abstract functions are defined", function() {
    14   test("check that the serialize and deserialize abstract functions are defined", function() {
    12       var dt = new IriSP.DataLoader();
    15       notEqual(this.ser.serialize, undefined, ".serialize is defined");
    13       var ser = new IriSP.Serializer(dt);
    16       notEqual(this.ser.deserialize, undefined, ".deserialize is defined");
    14       equal(ser.serialize(), undefined, ".serialize is defined");
    17   });
    15       equal(ser.deserialize(), undefined, ".deserialize is defined");
    18   
       
    19   test("check if currentMedia() is defined", function() {
       
    20   
    16   });
    21   });
    17 
    22 
    18 };
    23 };