11import { Refer , ReferAttributes } from '../../../../../models/bxml/verbs/Refer' ;
2- import { SipUri } from '../../../../../models/bxml/verbs/SipUri ' ;
2+ import { ReferSipUri } from '../../../../../models/bxml/verbs/ReferSipUri ' ;
33
44describe ( 'Refer' , ( ) => {
55 test ( 'should generate Refer XML with SipUri and all attributes' , ( ) => {
@@ -8,8 +8,8 @@ describe('Refer', () => {
88 referCompleteMethod : 'POST' ,
99 tag : 'my-tag' ,
1010 } ;
11- const sipUri = new SipUri ( 'sip:alice@atlanta.example.com' ) ;
12- const refer = new Refer ( attributes , sipUri ) ;
11+ const sipUri = new ReferSipUri ( 'sip:alice@atlanta.example.com' ) ;
12+ const refer = new Refer ( sipUri , attributes ) ;
1313
1414 const xml = refer . toBxml ( ) ;
1515 expect ( xml ) . toContain ( '<Refer' ) ;
@@ -21,23 +21,22 @@ describe('Refer', () => {
2121 } ) ;
2222
2323 test ( 'should generate Refer XML with no attributes' , ( ) => {
24- const sipUri = new SipUri ( 'sip:bob@biloxi.example.com' ) ;
25- const refer = new Refer ( undefined , sipUri ) ;
24+ const sipUri = new ReferSipUri ( 'sip:bob@biloxi.example.com' ) ;
25+ const refer = new Refer ( sipUri ) ;
2626
2727 const xml = refer . toBxml ( ) ;
2828 expect ( xml ) . toContain ( '<Refer>' ) ;
2929 expect ( xml ) . toContain ( '<SipUri>sip:bob@biloxi.example.com</SipUri>' ) ;
3030 } ) ;
3131
3232 test ( 'setSipUri should replace the nested SipUri' , ( ) => {
33- const sipUri1 = new SipUri ( 'sip:alice@atlanta.example.com' ) ;
34- const sipUri2 = new SipUri ( 'sip:bob@biloxi.example.com' ) ;
35- const refer = new Refer ( { } , sipUri1 ) ;
33+ const sipUri1 = new ReferSipUri ( 'sip:alice@atlanta.example.com' ) ;
34+ const sipUri2 = new ReferSipUri ( 'sip:bob@biloxi.example.com' ) ;
35+ const refer = new Refer ( sipUri1 ) ;
3636
3737 refer . setSipUri ( sipUri2 ) ;
3838 const xml = refer . toBxml ( ) ;
3939 expect ( xml ) . not . toContain ( 'alice' ) ;
4040 expect ( xml ) . toContain ( 'sip:bob@biloxi.example.com' ) ;
4141 } ) ;
4242} ) ;
43-
0 commit comments