unittests/tests/serializer.js
author hamidouk
Wed, 12 Oct 2011 13:59:38 +0200
branchpopcorn-port
changeset 68 5469b2b9743f
parent 65 6a8cae20f190
child 83 1fb63a1a8ac3
permissions -rw-r--r--
fixed an error in dataloader.js test.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
57
eabfc9a2eb35 Added unit testing with QUnit.
hamidouk
parents:
diff changeset
     1
function test_serializer() {
eabfc9a2eb35 Added unit testing with QUnit.
hamidouk
parents:
diff changeset
     2
  module("Serializer basic tests");
eabfc9a2eb35 Added unit testing with QUnit.
hamidouk
parents:
diff changeset
     3
  
65
6a8cae20f190 Added new unit tests and changes to the data classes.
hamidouk
parents: 57
diff changeset
     4
  test("init the serializer with a DataLoader and an url", function() {
6a8cae20f190 Added new unit tests and changes to the data classes.
hamidouk
parents: 57
diff changeset
     5
      var dt = new IriSP.DataLoader();
6a8cae20f190 Added new unit tests and changes to the data classes.
hamidouk
parents: 57
diff changeset
     6
      var ser = new IriSP.Serializer(dt, "http://google.com");
6a8cae20f190 Added new unit tests and changes to the data classes.
hamidouk
parents: 57
diff changeset
     7
      equal( ser._DataLoader, dt, "The dataloader reference is copied to the object." );
6a8cae20f190 Added new unit tests and changes to the data classes.
hamidouk
parents: 57
diff changeset
     8
      equal( ser._url, "http://google.com", "The url has been copied as well." );
6a8cae20f190 Added new unit tests and changes to the data classes.
hamidouk
parents: 57
diff changeset
     9
  });
6a8cae20f190 Added new unit tests and changes to the data classes.
hamidouk
parents: 57
diff changeset
    10
  
6a8cae20f190 Added new unit tests and changes to the data classes.
hamidouk
parents: 57
diff changeset
    11
  test("check that the serialize and deserialize abstract functions are defined", function() {
6a8cae20f190 Added new unit tests and changes to the data classes.
hamidouk
parents: 57
diff changeset
    12
      var dt = new IriSP.DataLoader();
6a8cae20f190 Added new unit tests and changes to the data classes.
hamidouk
parents: 57
diff changeset
    13
      var ser = new IriSP.Serializer(dt);
6a8cae20f190 Added new unit tests and changes to the data classes.
hamidouk
parents: 57
diff changeset
    14
      equal(ser.serialize(), undefined, ".serialize is defined");
6a8cae20f190 Added new unit tests and changes to the data classes.
hamidouk
parents: 57
diff changeset
    15
      equal(ser.deserialize(), undefined, ".deserialize is defined");
57
eabfc9a2eb35 Added unit testing with QUnit.
hamidouk
parents:
diff changeset
    16
  });
eabfc9a2eb35 Added unit testing with QUnit.
hamidouk
parents:
diff changeset
    17
eabfc9a2eb35 Added unit testing with QUnit.
hamidouk
parents:
diff changeset
    18
};