unittests/tests/serializer.js
author veltr
Fri, 29 Jun 2012 16:22:52 +0200
branchnew-model
changeset 923 b3ee7d1b472a
parent 185 2ccec6201261
permissions -rw-r--r--
UI improvements
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() {
83
1fb63a1a8ac3 various changes to unit tests.
hamidouk
parents: 65
diff changeset
     2
  module("Serializer basic tests", {setup: function() {
1fb63a1a8ac3 various changes to unit tests.
hamidouk
parents: 65
diff changeset
     3
    this.dt = new IriSP.DataLoader();
1fb63a1a8ac3 various changes to unit tests.
hamidouk
parents: 65
diff changeset
     4
    this.ser = new IriSP.Serializer(this.dt, "http://google.com");
1fb63a1a8ac3 various changes to unit tests.
hamidouk
parents: 65
diff changeset
     5
  }});
57
eabfc9a2eb35 Added unit testing with QUnit.
hamidouk
parents:
diff changeset
     6
  
65
6a8cae20f190 Added new unit tests and changes to the data classes.
hamidouk
parents: 57
diff changeset
     7
  test("init the serializer with a DataLoader and an url", function() {
83
1fb63a1a8ac3 various changes to unit tests.
hamidouk
parents: 65
diff changeset
     8
      
1fb63a1a8ac3 various changes to unit tests.
hamidouk
parents: 65
diff changeset
     9
      equal( this.ser._DataLoader, this.dt, "The dataloader reference is copied to the object." );
185
2ccec6201261 changed test value to new default value.
hamidouk
parents: 83
diff changeset
    10
      equal( this.ser._url, "http://google.com", "The url has been copied as well." );      
2ccec6201261 changed test value to new default value.
hamidouk
parents: 83
diff changeset
    11
      deepEqual( this.ser._data, [], "The serializer data is not defined." );
65
6a8cae20f190 Added new unit tests and changes to the data classes.
hamidouk
parents: 57
diff changeset
    12
  });
6a8cae20f190 Added new unit tests and changes to the data classes.
hamidouk
parents: 57
diff changeset
    13
  
6a8cae20f190 Added new unit tests and changes to the data classes.
hamidouk
parents: 57
diff changeset
    14
  test("check that the serialize and deserialize abstract functions are defined", function() {
83
1fb63a1a8ac3 various changes to unit tests.
hamidouk
parents: 65
diff changeset
    15
      notEqual(this.ser.serialize, undefined, ".serialize is defined");
1fb63a1a8ac3 various changes to unit tests.
hamidouk
parents: 65
diff changeset
    16
      notEqual(this.ser.deserialize, undefined, ".deserialize is defined");
1fb63a1a8ac3 various changes to unit tests.
hamidouk
parents: 65
diff changeset
    17
  });
1fb63a1a8ac3 various changes to unit tests.
hamidouk
parents: 65
diff changeset
    18
  
1fb63a1a8ac3 various changes to unit tests.
hamidouk
parents: 65
diff changeset
    19
  test("check if currentMedia() is defined", function() {
1fb63a1a8ac3 various changes to unit tests.
hamidouk
parents: 65
diff changeset
    20
  
57
eabfc9a2eb35 Added unit testing with QUnit.
hamidouk
parents:
diff changeset
    21
  });
eabfc9a2eb35 Added unit testing with QUnit.
hamidouk
parents:
diff changeset
    22
eabfc9a2eb35 Added unit testing with QUnit.
hamidouk
parents:
diff changeset
    23
};