@@ -19,7 +19,7 @@ public class ApplicationTest
1919 // [TestInitialize]
2020 public ApplicationTest ( )
2121 {
22- Helper . SetEnvironmetVariables ( ) ;
22+ Helper . SetEnvironmentVariables ( ) ;
2323
2424 }
2525
@@ -55,7 +55,7 @@ public void TestApplicationProvisioningResponse()
5555 var actual = Helper . ToXmlStringMinified ( apresponse ) ;
5656
5757 //Linerize the XML
58- XDocument doc = XDocument . Parse ( TestXmlStrings . multiApplicationProvisionResponse ) ;
58+ XDocument doc = XDocument . Parse ( TestXmlStrings . multiApplicationProvisionResponse ) ;
5959 var xmlExpected = doc . ToString ( SaveOptions . DisableFormatting ) ;
6060
6161
@@ -82,7 +82,7 @@ public void TestApplicationProvisioningResponse()
8282 } ;
8383
8484 actual = Helper . ToXmlStringMinified ( apresponse ) ;
85- xmlExpected = XDocument . Parse ( TestXmlStrings . singleApplicationProvisionResponse ) . ToString ( SaveOptions . DisableFormatting ) ;
85+ xmlExpected = XDocument . Parse ( TestXmlStrings . singleApplicationProvisionResponse ) . ToString ( SaveOptions . DisableFormatting ) ;
8686
8787 Assert . Equal ( xmlExpected , actual ) ;
8888
@@ -128,7 +128,7 @@ public void TestAssociatedSipPeersResponse()
128128 public void TestListApplications ( )
129129 {
130130
131- string strResponse = XDocument . Parse ( TestXmlStrings . multiApplicationProvisionResponse ) . ToString ( SaveOptions . DisableFormatting ) ;
131+ string strResponse = XDocument . Parse ( TestXmlStrings . multiApplicationProvisionResponse ) . ToString ( SaveOptions . DisableFormatting ) ;
132132
133133 using ( var server = new HttpServer ( new RequestHandler
134134 {
@@ -144,12 +144,12 @@ public void TestListApplications()
144144 var r = t . Result ;
145145 if ( server . Error != null ) throw server . Error ;
146146
147- Assert . Equal ( r . ApplicationList . Length , 2 ) ;
147+ Assert . Equal ( 2 , r . ApplicationList . Length ) ;
148148
149- Assert . Equal ( r . ApplicationList [ 0 ] . ApplicationId , "2cfcb382-161c-46d4-8c67-87ca09a72c85" ) ;
150- Assert . Equal ( r . ApplicationList [ 0 ] . ServiceType , "Messaging-V2" ) ;
151- Assert . Equal ( r . ApplicationList [ 0 ] . AppName , "app1" ) ;
152- Assert . Equal ( r . ApplicationList [ 0 ] . MsgCallbackUrl , "http://a.com" ) ;
149+ Assert . Equal ( "2cfcb382-161c-46d4-8c67-87ca09a72c85" , r . ApplicationList [ 0 ] . ApplicationId ) ;
150+ Assert . Equal ( "Messaging-V2" , r . ApplicationList [ 0 ] . ServiceType ) ;
151+ Assert . Equal ( "app1" , r . ApplicationList [ 0 ] . AppName ) ;
152+ Assert . Equal ( "http://a.com" , r . ApplicationList [ 0 ] . MsgCallbackUrl ) ;
153153
154154
155155 }
@@ -192,14 +192,14 @@ public void TestCreateApplication()
192192
193193 Assert . NotNull ( r . Application ) ;
194194
195- Assert . Equal ( r . Application . ApplicationId , "d3e418e9-1833-49c1-b6c7-ca1700f79586" ) ;
196- Assert . Equal ( r . Application . ServiceType , "Voice-V2" ) ;
197- Assert . Equal ( r . Application . AppName , "v1" ) ;
198- Assert . Equal ( r . Application . CallInitiatedCallbackUrl , "https://a.com" ) ;
199- Assert . Equal ( r . Application . CallStatusCallbackUrl , "https://b.com" ) ;
200- Assert . Equal ( r . Application . CallInitiatedMethod , "GET" ) ;
201- Assert . Equal ( r . Application . CallStatusMethod , "GET" ) ;
202- Assert . Equal ( r . Application . CallbackCreds . UserId , "login123" ) ;
195+ Assert . Equal ( "d3e418e9-1833-49c1-b6c7-ca1700f79586" , r . Application . ApplicationId ) ;
196+ Assert . Equal ( "Voice-V2" , r . Application . ServiceType ) ;
197+ Assert . Equal ( "v1" , r . Application . AppName ) ;
198+ Assert . Equal ( "https://a.com" , r . Application . CallInitiatedCallbackUrl ) ;
199+ Assert . Equal ( "https://b.com" , r . Application . CallStatusCallbackUrl ) ;
200+ Assert . Equal ( "GET" , r . Application . CallInitiatedMethod ) ;
201+ Assert . Equal ( "GET" , r . Application . CallStatusMethod ) ;
202+ Assert . Equal ( "login123" , r . Application . CallbackCreds . UserId ) ;
203203
204204
205205 }
@@ -230,14 +230,14 @@ public void TestGetApplication()
230230
231231 Assert . NotNull ( r . Application ) ;
232232
233- Assert . Equal ( r . Application . ApplicationId , "d3e418e9-1833-49c1-b6c7-ca1700f79586" ) ;
234- Assert . Equal ( r . Application . ServiceType , "Voice-V2" ) ;
235- Assert . Equal ( r . Application . AppName , "v1" ) ;
236- Assert . Equal ( r . Application . CallInitiatedCallbackUrl , "https://a.com" ) ;
237- Assert . Equal ( r . Application . CallStatusCallbackUrl , "https://b.com" ) ;
238- Assert . Equal ( r . Application . CallInitiatedMethod , "GET" ) ;
239- Assert . Equal ( r . Application . CallStatusMethod , "GET" ) ;
240- Assert . Equal ( r . Application . CallbackCreds . UserId , "login123" ) ;
233+ Assert . Equal ( "d3e418e9-1833-49c1-b6c7-ca1700f79586" , r . Application . ApplicationId ) ;
234+ Assert . Equal ( "Voice-V2" , r . Application . ServiceType ) ;
235+ Assert . Equal ( "v1" , r . Application . AppName ) ;
236+ Assert . Equal ( "https://a.com" , r . Application . CallInitiatedCallbackUrl ) ;
237+ Assert . Equal ( "https://b.com" , r . Application . CallStatusCallbackUrl ) ;
238+ Assert . Equal ( "GET" , r . Application . CallInitiatedMethod ) ;
239+ Assert . Equal ( "GET" , r . Application . CallStatusMethod ) ;
240+ Assert . Equal ( "login123" , r . Application . CallbackCreds . UserId ) ;
241241
242242
243243 }
@@ -272,14 +272,14 @@ public void TestFullUpdateApplication()
272272
273273 Assert . NotNull ( r . Application ) ;
274274
275- Assert . Equal ( r . Application . ApplicationId , "d3e418e9-1833-49c1-b6c7-ca1700f79586" ) ;
276- Assert . Equal ( r . Application . ServiceType , "Voice-V2" ) ;
277- Assert . Equal ( r . Application . AppName , "v1" ) ;
278- Assert . Equal ( r . Application . CallInitiatedCallbackUrl , "https://a.com" ) ;
279- Assert . Equal ( r . Application . CallStatusCallbackUrl , "https://b.com" ) ;
280- Assert . Equal ( r . Application . CallInitiatedMethod , "GET" ) ;
281- Assert . Equal ( r . Application . CallStatusMethod , "GET" ) ;
282- Assert . Equal ( r . Application . CallbackCreds . UserId , "login123" ) ;
275+ Assert . Equal ( "d3e418e9-1833-49c1-b6c7-ca1700f79586" , r . Application . ApplicationId ) ;
276+ Assert . Equal ( "Voice-V2" , r . Application . ServiceType ) ;
277+ Assert . Equal ( "v1" , r . Application . AppName ) ;
278+ Assert . Equal ( "https://a.com" , r . Application . CallInitiatedCallbackUrl ) ;
279+ Assert . Equal ( "https://b.com" , r . Application . CallStatusCallbackUrl ) ;
280+ Assert . Equal ( "GET" , r . Application . CallInitiatedMethod ) ;
281+ Assert . Equal ( "GET" , r . Application . CallStatusMethod ) ;
282+ Assert . Equal ( "login123" , r . Application . CallbackCreds . UserId ) ;
283283
284284
285285 }
@@ -314,14 +314,14 @@ public void TestPartialUpdateApplication()
314314
315315 Assert . NotNull ( r . Application ) ;
316316
317- Assert . Equal ( r . Application . ApplicationId , "d3e418e9-1833-49c1-b6c7-ca1700f79586" ) ;
318- Assert . Equal ( r . Application . ServiceType , "Voice-V2" ) ;
319- Assert . Equal ( r . Application . AppName , "v1" ) ;
320- Assert . Equal ( r . Application . CallInitiatedCallbackUrl , "https://a.com" ) ;
321- Assert . Equal ( r . Application . CallStatusCallbackUrl , "https://b.com" ) ;
322- Assert . Equal ( r . Application . CallInitiatedMethod , "GET" ) ;
323- Assert . Equal ( r . Application . CallStatusMethod , "GET" ) ;
324- Assert . Equal ( r . Application . CallbackCreds . UserId , "login123" ) ;
317+ Assert . Equal ( "d3e418e9-1833-49c1-b6c7-ca1700f79586" , r . Application . ApplicationId ) ;
318+ Assert . Equal ( "Voice-V2" , r . Application . ServiceType ) ;
319+ Assert . Equal ( "v1" , r . Application . AppName ) ;
320+ Assert . Equal ( "https://a.com" , r . Application . CallInitiatedCallbackUrl ) ;
321+ Assert . Equal ( "https://b.com" , r . Application . CallStatusCallbackUrl ) ;
322+ Assert . Equal ( "GET" , r . Application . CallInitiatedMethod ) ;
323+ Assert . Equal ( "GET" , r . Application . CallStatusMethod ) ;
324+ Assert . Equal ( "login123" , r . Application . CallbackCreds . UserId ) ;
325325
326326
327327 }
@@ -374,11 +374,11 @@ public void TestGetAssociatesSipPeers()
374374
375375 Assert . NotNull ( r . AssociatedSipPeers ) ;
376376
377- Assert . Equal ( r . AssociatedSipPeers . Length , 2 ) ;
378- Assert . Equal ( r . AssociatedSipPeers [ 0 ] . SiteId , "13651" ) ;
379- Assert . Equal ( r . AssociatedSipPeers [ 0 ] . SiteName , "Prod Sub-account" ) ;
380- Assert . Equal ( r . AssociatedSipPeers [ 0 ] . PeerId , "540341" ) ;
381- Assert . Equal ( r . AssociatedSipPeers [ 0 ] . PeerName , "Prod" ) ;
377+ Assert . Equal ( 2 , r . AssociatedSipPeers . Length ) ;
378+ Assert . Equal ( "13651" , r . AssociatedSipPeers [ 0 ] . SiteId ) ;
379+ Assert . Equal ( "Prod Sub-account" , r . AssociatedSipPeers [ 0 ] . SiteName ) ;
380+ Assert . Equal ( "540341" , r . AssociatedSipPeers [ 0 ] . PeerId ) ;
381+ Assert . Equal ( "Prod" , r . AssociatedSipPeers [ 0 ] . PeerName ) ;
382382
383383
384384
@@ -395,7 +395,8 @@ public void TestGetAssociatesSipPeers400()
395395 {
396396 EstimatedMethod = "GET" ,
397397 EstimatedPathAndQuery = $ "/v1.0/accounts/{ Helper . AccountId } /applications/{ applicationId } /associatedsippeers",
398- ContentToSend = new StringContent ( TestXmlStrings . associatedSipPeerResponse400 , Encoding . UTF8 , "application/xml" )
398+ ContentToSend = new StringContent ( TestXmlStrings . associatedSipPeerResponse400 , Encoding . UTF8 , "application/xml" ) ,
399+ StatusCodeToSend = 400
399400 } ) )
400401
401402 {
@@ -405,13 +406,14 @@ public void TestGetAssociatesSipPeers400()
405406 {
406407 var r = t . Result ;
407408 Assert . True ( false , "The exception was not thrown" ) ;
408- } catch ( AggregateException e )
409+ }
410+ catch ( AggregateException e )
409411 {
410- e . Handle ( ex =>
412+ e . Handle ( ex =>
411413 {
412- if ( ex is BandwidthIrisException )
414+ if ( ex is BandwidthIrisException )
413415 {
414- Assert . Equal ( ex . Message , " Current 1 Account have no Catapult association " ) ;
416+ Assert . Equal ( " Current 1 Account have no Catapult association " , ex . Message ) ;
415417 return true ;
416418 }
417419 return true ;
@@ -431,7 +433,8 @@ public void TestGetAssociatesSipPeers404()
431433 {
432434 EstimatedMethod = "GET" ,
433435 EstimatedPathAndQuery = $ "/v1.0/accounts/{ Helper . AccountId } /applications/{ applicationId } /associatedsippeers",
434- ContentToSend = new StringContent ( TestXmlStrings . associatedSipPeerResponse404 , Encoding . UTF8 , "application/xml" )
436+ ContentToSend = new StringContent ( TestXmlStrings . associatedSipPeerResponse404 , Encoding . UTF8 , "application/xml" ) ,
437+ StatusCodeToSend = 404
435438 } ) )
436439
437440 {
@@ -448,7 +451,7 @@ public void TestGetAssociatesSipPeers404()
448451 {
449452 if ( ex is BandwidthIrisException )
450453 {
451- Assert . Equal ( ex . Message , " Application with id 'non_existing' not found " ) ;
454+ Assert . Equal ( " Application with id 'non_existing' not found " , ex . Message ) ;
452455 return true ;
453456 }
454457 return true ;
0 commit comments