-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SWI-4281 Add
addVerbs
method to Root Class (#16)
* SWI-4281 Add `addVerbs` method to Root Class * add tests * add tests for other nestable verbs * update name of gather add verbs method * update all nested verb accepting methods to accept single or multiple verbs * update tests * comment * small test updates
- Loading branch information
Showing
14 changed files
with
170 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,46 @@ | ||
const { Response } = require('../../../models/bxml/Response'); | ||
const { PauseRecording } = require('../../../models/bxml/verbs/PauseRecording'); | ||
const { Root } = require('../../../models/bxml/Root'); | ||
|
||
describe('Bxml', () => { | ||
test('should create a bxml object', () => { | ||
describe('Response', () => { | ||
const pauseRecording = new PauseRecording(); | ||
|
||
test('should create a response object', () => { | ||
const response = new Response(); | ||
const expected = '<?xml version="1.0" encoding="UTF-8"?><Response/>'; | ||
|
||
expect(response).toBeInstanceOf(Response); | ||
expect(response).toBeInstanceOf(Root); | ||
expect(response.toBxml()).toBe(expected); | ||
}); | ||
|
||
test('should initialize with a single nested verb', () => { | ||
const response = new Response(pauseRecording); | ||
const expected = '<?xml version="1.0" encoding="UTF-8"?><Response><PauseRecording/></Response>'; | ||
|
||
expect(response.toBxml()).toBe(expected); | ||
}); | ||
|
||
test('should initialize with multiple nested verbs', () => { | ||
const response = new Response([pauseRecording, pauseRecording]); | ||
const expected = '<?xml version="1.0" encoding="UTF-8"?><Response><PauseRecording/><PauseRecording/></Response>'; | ||
|
||
expect(response.toBxml()).toBe(expected); | ||
}); | ||
|
||
test('should add a single nested verb', () => { | ||
const response = new Response(); | ||
response.addVerbs(pauseRecording); | ||
const expected = '<?xml version="1.0" encoding="UTF-8"?><Response><PauseRecording/></Response>'; | ||
|
||
expect(response.toBxml()).toBe(expected); | ||
}); | ||
|
||
test('should add multiple nested verbs', () => { | ||
const response = new Response(); | ||
response.addVerbs([pauseRecording, pauseRecording]); | ||
const expected = '<?xml version="1.0" encoding="UTF-8"?><Response><PauseRecording/><PauseRecording/></Response>'; | ||
|
||
expect(response.toBxml()).toBe(expected); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.