unittests/tests/serializer.js
author hamidouk
Tue, 29 Nov 2011 11:09:08 +0100
branchpopcorn-port
changeset 345 8a088f7daa66
parent 185 2ccec6201261
permissions -rw-r--r--
rollover over the interface buttons now works as expected. Also changed the width of the buttons to the correct size. Resized the width and height of the sprites to be the same as the boxes we display them in.
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
};