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 }; |