Skip to content

Commit

Permalink
test(*): fix test regression
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Casey <[email protected]>
  • Loading branch information
jonathan-casey committed Nov 9, 2023
1 parent 3412f86 commit 97f1b3f
Showing 1 changed file with 31 additions and 55 deletions.
86 changes: 31 additions & 55 deletions test/codegen/fromcto/xmlschema/xmlschemavisitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,17 +411,13 @@ describe('XmlSchemaVisitor', function () {

xmlSchemaVisitor.visitMapDeclaration(mockMapDeclaration, param);

param.fileWriter.writeLine.callCount.should.deep.equal(10);
param.fileWriter.writeLine.callCount.should.deep.equal(7);
param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, '<xs:complexType name="Map1">']);
param.fileWriter.writeLine.getCall(1).args.should.deep.equal([1, '<xs:sequence>']);
param.fileWriter.writeLine.getCall(2).args.should.deep.equal([2, '<xs:complexType>']);
param.fileWriter.writeLine.getCall(3).args.should.deep.equal([3, '<xs:sequence>']);
param.fileWriter.writeLine.getCall(4).args.should.deep.equal([4, '<xs:element name="key" type="xs:string"/>']);
param.fileWriter.writeLine.getCall(5).args.should.deep.equal([4, '<xs:element name="value" type="xs:string"/>']);
param.fileWriter.writeLine.getCall(6).args.should.deep.equal([3, '</xs:sequence>']);
param.fileWriter.writeLine.getCall(7).args.should.deep.equal([2, '</xs:complexType>']);
param.fileWriter.writeLine.getCall(8).args.should.deep.equal([1, '</xs:sequence>']);
param.fileWriter.writeLine.getCall(9).args.should.deep.equal([0, '</xs:complexType>']);
param.fileWriter.writeLine.getCall(2).args.should.deep.equal([2, '<xs:element name="key" type="xs:string"/>']);
param.fileWriter.writeLine.getCall(3).args.should.deep.equal([2, '<xs:element name="value" type="xs:string"/>']);
param.fileWriter.writeLine.getCall(4).args.should.deep.equal([1, '</xs:sequence>']);
param.fileWriter.writeLine.getCall(5).args.should.deep.equal([0, '</xs:complexType>']);
});


Expand Down Expand Up @@ -455,17 +451,13 @@ describe('XmlSchemaVisitor', function () {

xmlSchemaVisitor.visitMapDeclaration(mockMapDeclaration, param);

param.fileWriter.writeLine.callCount.should.deep.equal(10);
param.fileWriter.writeLine.callCount.should.deep.equal(7);
param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, '<xs:complexType name="Map1">']);
param.fileWriter.writeLine.getCall(1).args.should.deep.equal([1, '<xs:sequence>']);
param.fileWriter.writeLine.getCall(2).args.should.deep.equal([2, '<xs:complexType>']);
param.fileWriter.writeLine.getCall(3).args.should.deep.equal([3, '<xs:sequence>']);
param.fileWriter.writeLine.getCall(4).args.should.deep.equal([4, '<xs:element name="key" type="xs:string"/>']);
param.fileWriter.writeLine.getCall(5).args.should.deep.equal([4, '<xs:element name="value" type="xs:string"/>']);
param.fileWriter.writeLine.getCall(6).args.should.deep.equal([3, '</xs:sequence>']);
param.fileWriter.writeLine.getCall(7).args.should.deep.equal([2, '</xs:complexType>']);
param.fileWriter.writeLine.getCall(8).args.should.deep.equal([1, '</xs:sequence>']);
param.fileWriter.writeLine.getCall(9).args.should.deep.equal([0, '</xs:complexType>']);
param.fileWriter.writeLine.getCall(2).args.should.deep.equal([2, '<xs:element name="key" type="xs:string"/>']);
param.fileWriter.writeLine.getCall(3).args.should.deep.equal([2, '<xs:element name="value" type="xs:string"/>']);
param.fileWriter.writeLine.getCall(4).args.should.deep.equal([1, '</xs:sequence>']);
param.fileWriter.writeLine.getCall(5).args.should.deep.equal([0, '</xs:complexType>']);
});

it('should write the map declaration for a map <string, Person>', () => {
Expand Down Expand Up @@ -496,17 +488,13 @@ describe('XmlSchemaVisitor', function () {

xmlSchemaVisitor.visitMapDeclaration(mockMapDeclaration, param);

param.fileWriter.writeLine.callCount.should.deep.equal(10);
param.fileWriter.writeLine.callCount.should.deep.equal(7);
param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, '<xs:complexType name="Map1">']);
param.fileWriter.writeLine.getCall(1).args.should.deep.equal([1, '<xs:sequence>']);
param.fileWriter.writeLine.getCall(2).args.should.deep.equal([2, '<xs:complexType>']);
param.fileWriter.writeLine.getCall(3).args.should.deep.equal([3, '<xs:sequence>']);
param.fileWriter.writeLine.getCall(4).args.should.deep.equal([4, '<xs:element name="key" type="xs:string"/>']);
param.fileWriter.writeLine.getCall(5).args.should.deep.equal([4, '<xs:element name="value" type="org.acme:Person"/>']);
param.fileWriter.writeLine.getCall(6).args.should.deep.equal([3, '</xs:sequence>']);
param.fileWriter.writeLine.getCall(7).args.should.deep.equal([2, '</xs:complexType>']);
param.fileWriter.writeLine.getCall(8).args.should.deep.equal([1, '</xs:sequence>']);
param.fileWriter.writeLine.getCall(9).args.should.deep.equal([0, '</xs:complexType>']);
param.fileWriter.writeLine.getCall(2).args.should.deep.equal([2, '<xs:element name="key" type="xs:string"/>']);
param.fileWriter.writeLine.getCall(3).args.should.deep.equal([2, '<xs:element name="value" type="org.acme:Person"/>']);
param.fileWriter.writeLine.getCall(4).args.should.deep.equal([1, '</xs:sequence>']);
param.fileWriter.writeLine.getCall(5).args.should.deep.equal([0, '</xs:complexType>']);

});

Expand Down Expand Up @@ -536,17 +524,13 @@ describe('XmlSchemaVisitor', function () {

xmlSchemaVisitor.visitMapDeclaration(mockMapDeclaration, param);

param.fileWriter.writeLine.callCount.should.deep.equal(10);
param.fileWriter.writeLine.callCount.should.deep.equal(7);
param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, '<xs:complexType name="Map1">']);
param.fileWriter.writeLine.getCall(1).args.should.deep.equal([1, '<xs:sequence>']);
param.fileWriter.writeLine.getCall(2).args.should.deep.equal([2, '<xs:complexType>']);
param.fileWriter.writeLine.getCall(3).args.should.deep.equal([3, '<xs:sequence>']);
param.fileWriter.writeLine.getCall(4).args.should.deep.equal([4, '<xs:element name="key" type="xs:string"/>']);
param.fileWriter.writeLine.getCall(5).args.should.deep.equal([4, '<xs:element name="value" type="xs:long"/>']);
param.fileWriter.writeLine.getCall(6).args.should.deep.equal([3, '</xs:sequence>']);
param.fileWriter.writeLine.getCall(7).args.should.deep.equal([2, '</xs:complexType>']);
param.fileWriter.writeLine.getCall(8).args.should.deep.equal([1, '</xs:sequence>']);
param.fileWriter.writeLine.getCall(9).args.should.deep.equal([0, '</xs:complexType>']);
param.fileWriter.writeLine.getCall(2).args.should.deep.equal([2, '<xs:element name="key" type="xs:string"/>']);
param.fileWriter.writeLine.getCall(3).args.should.deep.equal([2, '<xs:element name="value" type="xs:long"/>']);
param.fileWriter.writeLine.getCall(4).args.should.deep.equal([1, '</xs:sequence>']);
param.fileWriter.writeLine.getCall(5).args.should.deep.equal([0, '</xs:complexType>']);
});

it('should write the map declaration for a map <string, Double>', () => {
Expand Down Expand Up @@ -576,17 +560,13 @@ describe('XmlSchemaVisitor', function () {

xmlSchemaVisitor.visitMapDeclaration(mockMapDeclaration, param);

param.fileWriter.writeLine.callCount.should.deep.equal(10);
param.fileWriter.writeLine.callCount.should.deep.equal(7);
param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, '<xs:complexType name="Map1">']);
param.fileWriter.writeLine.getCall(1).args.should.deep.equal([1, '<xs:sequence>']);
param.fileWriter.writeLine.getCall(2).args.should.deep.equal([2, '<xs:complexType>']);
param.fileWriter.writeLine.getCall(3).args.should.deep.equal([3, '<xs:sequence>']);
param.fileWriter.writeLine.getCall(4).args.should.deep.equal([4, '<xs:element name="key" type="xs:string"/>']);
param.fileWriter.writeLine.getCall(5).args.should.deep.equal([4, '<xs:element name="value" type="xs:double"/>']);
param.fileWriter.writeLine.getCall(6).args.should.deep.equal([3, '</xs:sequence>']);
param.fileWriter.writeLine.getCall(7).args.should.deep.equal([2, '</xs:complexType>']);
param.fileWriter.writeLine.getCall(8).args.should.deep.equal([1, '</xs:sequence>']);
param.fileWriter.writeLine.getCall(9).args.should.deep.equal([0, '</xs:complexType>']);
param.fileWriter.writeLine.getCall(2).args.should.deep.equal([2, '<xs:element name="key" type="xs:string"/>']);
param.fileWriter.writeLine.getCall(3).args.should.deep.equal([2, '<xs:element name="value" type="xs:double"/>']);
param.fileWriter.writeLine.getCall(4).args.should.deep.equal([1, '</xs:sequence>']);
param.fileWriter.writeLine.getCall(5).args.should.deep.equal([0, '</xs:complexType>']);
});

it('should write the map declaration for a map <string, Integer>', () => {
Expand Down Expand Up @@ -616,17 +596,13 @@ describe('XmlSchemaVisitor', function () {

xmlSchemaVisitor.visitMapDeclaration(mockMapDeclaration, param);

param.fileWriter.writeLine.callCount.should.deep.equal(10);
param.fileWriter.writeLine.callCount.should.deep.equal(7);
param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, '<xs:complexType name="Map1">']);
param.fileWriter.writeLine.getCall(1).args.should.deep.equal([1, '<xs:sequence>']);
param.fileWriter.writeLine.getCall(2).args.should.deep.equal([2, '<xs:complexType>']);
param.fileWriter.writeLine.getCall(3).args.should.deep.equal([3, '<xs:sequence>']);
param.fileWriter.writeLine.getCall(4).args.should.deep.equal([4, '<xs:element name="key" type="xs:string"/>']);
param.fileWriter.writeLine.getCall(5).args.should.deep.equal([4, '<xs:element name="value" type="xs:integer"/>']);
param.fileWriter.writeLine.getCall(6).args.should.deep.equal([3, '</xs:sequence>']);
param.fileWriter.writeLine.getCall(7).args.should.deep.equal([2, '</xs:complexType>']);
param.fileWriter.writeLine.getCall(8).args.should.deep.equal([1, '</xs:sequence>']);
param.fileWriter.writeLine.getCall(9).args.should.deep.equal([0, '</xs:complexType>']);
param.fileWriter.writeLine.getCall(2).args.should.deep.equal([2, '<xs:element name="key" type="xs:string"/>']);
param.fileWriter.writeLine.getCall(3).args.should.deep.equal([2, '<xs:element name="value" type="xs:integer"/>']);
param.fileWriter.writeLine.getCall(4).args.should.deep.equal([1, '</xs:sequence>']);
param.fileWriter.writeLine.getCall(5).args.should.deep.equal([0, '</xs:complexType>']);
});

});
Expand Down Expand Up @@ -794,4 +770,4 @@ describe('XmlSchemaVisitor', function () {
param.fileWriter.writeLine.withArgs(1, '+ string Bob');
});
});
});
});

0 comments on commit 97f1b3f

Please sign in to comment.