-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DX-2281 Add answer call for voice's ring BXML (#40)
* Add answer call for voice's ring BXML * Remove assert warnings
- Loading branch information
Showing
2 changed files
with
73 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
using Bandwidth.Standard.Voice.Bxml; | ||
using Xunit; | ||
|
||
namespace Bandwidth.StandardTests.Voice.Bxml | ||
{ | ||
public class RingTests | ||
{ | ||
[Fact] | ||
public void RingShouldBeDefaults() | ||
{ | ||
var ring = new Ring(); | ||
|
||
Assert.Equal(5, ring.Duration); | ||
Assert.True(ring.AnswerCall); | ||
} | ||
|
||
[Fact] | ||
public void RingDurationShouldBeTen() | ||
{ | ||
var ring = new Ring(); | ||
ring.Duration = 10; | ||
|
||
Assert.Equal(10, ring.Duration); | ||
} | ||
|
||
[Fact] | ||
public void RingAnswerCallShouldBeFalse() | ||
{ | ||
var ring = new Ring(); | ||
ring.AnswerCall = false; | ||
|
||
Assert.False(ring.AnswerCall); | ||
} | ||
|
||
[Fact] | ||
public void RingResponseToBXMLShouldBeDefaults() | ||
{ | ||
var ring = new Ring(); | ||
var response = new Response(ring); | ||
|
||
Assert.Equal("<?xml version=\"1.0\" encoding=\"utf-8\"?><Response> <Ring duration=\"5\" answerCall=\"true\" /></Response>", response.ToBXML()); | ||
} | ||
|
||
[Fact] | ||
public void RingDurationResponseToBXMLShouldBeThirty() | ||
{ | ||
var ring = new Ring(); | ||
ring.Duration = 30; | ||
|
||
var response = new Response(ring); | ||
|
||
Assert.Equal("<?xml version=\"1.0\" encoding=\"utf-8\"?><Response> <Ring duration=\"30\" answerCall=\"true\" /></Response>", response.ToBXML()); | ||
} | ||
|
||
[Fact] | ||
public void RingAnswerCallResponseToBXMLShouldBeFalse() | ||
{ | ||
var ring = new Ring(); | ||
ring.AnswerCall = false; | ||
|
||
var response = new Response(ring); | ||
|
||
Assert.Equal("<?xml version=\"1.0\" encoding=\"utf-8\"?><Response> <Ring duration=\"5\" answerCall=\"false\" /></Response>", response.ToBXML()); | ||
} | ||
} | ||
} |