Massive refactor for 3rd party import

This commit is contained in:
Colin McLeod
2015-07-19 21:32:14 -07:00
parent c796adf40d
commit 03986cb88a
50 changed files with 4278 additions and 156 deletions

View File

@@ -1,18 +1,19 @@
describe("Serializer Service", function() {
beforeEach(module('app'));
var Ship, Serializer;
var Ship,
Serializer,
code = '48A6A6A5A8A8A5C2c0o0o0o1m1m0q0q0404-0l0b0100034k5n052d04--0303326b',
anaconda = DB.ships['anaconda'],
testBuild,
exportData;
beforeEach(inject(function (_Ship_, _Serializer_) {
Ship = _Ship_;
Serializer = _Serializer_;
}));
describe("Detailed Export", function() {
var code = '48A6A6A5A8A8A5C2c0o0o0o1m1m0q0q0404-0l0b0100034k5n052d04--0303326b.AwRj4yo5dig=.MwBhEYy6duwEziA',
anaconda = DB.ships['anaconda'],
testBuild,
exportData;
describe("To Detailed Build", function() {
beforeEach(function() {
testBuild = new Ship('anaconda', anaconda.properties, anaconda.slots);
@@ -37,4 +38,20 @@ describe("Serializer Service", function() {
});
describe("From Detailed Build", function() {
it("builds the ship correctly", function() {
var anacondaTestExport = __json__['fixtures/anaconda-test-detailed-export'];
testBuildA = new Ship('anaconda', anaconda.properties, anaconda.slots);
Serializer.toShip(testBuildA, code);
testBuildB = Serializer.fromDetailedBuild(anacondaTestExport);
for(var p in testBuildB) {
expect(testBuildB[p]).toEqual(testBuildA[p], p + ' does not match');
}
});
});
});