Skip to content

Commit 4e89257

Browse files
committed
Add Test
1 parent 24a21b0 commit 4e89257

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

Bandwidth.Standard/Voice/Models/CreateCallRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ public string Tag
434434
/// <summary>
435435
/// Gets or sets Priority.
436436
/// </summary>
437-
[JsonProperty("tag")]
437+
[JsonProperty("priority")]
438438
public int? Priority
439439
{
440440
get

Bandwidth.StandardTests/Voice/CreateCallTests.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,35 @@ public async Task CreateCallWithMachineDetectionReturnsCreated()
8181
Assert.Equal(DisconnectMethodEnum.POST, createCallResponse.Data.DisconnectMethod);
8282
}
8383

84+
[Fact]
85+
public async Task CreateCallWithPriorityReturnsCreated()
86+
{
87+
var accountId = TestConstants.AccountId;
88+
var to = TestConstants.To;
89+
var from = TestConstants.From;
90+
var applicationId = TestConstants.VoiceApplicationId;
91+
var answerUrl = string.Concat(TestConstants.BaseCallbackUrl, "/callbacks/answer");
92+
var priority = 4;
93+
94+
var request = new CreateCallRequest()
95+
{
96+
ApplicationId = applicationId,
97+
To = to,
98+
From = from,
99+
AnswerUrl = answerUrl,
100+
Priority = priority
101+
};
102+
103+
var createCallResponse = await _client.Voice.APIController.CreateCallAsync(accountId, request);
104+
105+
Assert.Equal(201, createCallResponse.StatusCode);
106+
107+
Assert.Equal(applicationId, createCallResponse.Data.ApplicationId);
108+
Assert.Equal(to, createCallResponse.Data.To);
109+
Assert.Equal(from, createCallResponse.Data.From);
110+
Assert.Equal(priority, createCallResponse.Data.Priority);
111+
}
112+
84113
[Fact]
85114
public async Task CreateCallInvalidToPhoneNumberThrows()
86115
{

0 commit comments

Comments
 (0)