Skip to content

Commit

Permalink
fix: add missing AppId property on Number
Browse files Browse the repository at this point in the history
  • Loading branch information
Tr00d committed Jul 30, 2024
1 parent 7ea2677 commit d9193aa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Vonage.Test/NumbersTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,14 @@ public async Task GetOwnedNumbersAsync()
Assert.Equal("1.25", number.Cost);
Assert.Equal("VOICE", number.Features[0]);
Assert.Equal("SMS", number.Features[1]);
number.ApplicationId.Should().BeNull();
}

[Fact]
public async Task GetOwnedNumbersAsyncWithCredentials()
{
const string expectedResponse =
@"{""count"": 1234,""numbers"": [{""country"": ""GB"",""msisdn"": ""447700900000"",""type"": ""mobile-lvn"",""cost"": ""1.25"",""features"": [""VOICE"",""SMS""]}]}";
@"{""count"": 1234,""numbers"": [{""country"": ""GB"",""msisdn"": ""447700900000"",""type"": ""mobile-lvn"",""cost"": ""1.25"",""features"": [""VOICE"",""SMS""],""app_id"": ""9907a0d2-5206-4ec0-af8c-b335685ef9b8""}]}";
var expectedUri =
$"{this.RestUrl}/account/numbers?country=GB&type=mobile-lvn&pattern=12345&search_pattern=1&features=SMS&size=10&index=1&application_id=testApp&api_key={this.ApiKey}&api_secret={this.ApiSecret}&";
var request = new NumberSearchRequest
Expand All @@ -196,6 +197,7 @@ public async Task GetOwnedNumbersAsyncWithCredentials()
Assert.Equal("1.25", number.Cost);
Assert.Equal("VOICE", number.Features[0]);
Assert.Equal("SMS", number.Features[1]);
number.ApplicationId.Should().Be("9907a0d2-5206-4ec0-af8c-b335685ef9b8");
}

[Fact]
Expand Down
8 changes: 8 additions & 0 deletions Vonage/Numbers/Number.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#region
using Newtonsoft.Json;
#endregion

namespace Vonage.Numbers;

Expand Down Expand Up @@ -33,4 +35,10 @@ public class Number
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }

/// <summary>
/// The application Id.
/// </summary>
[JsonProperty("app_id")]
public string ApplicationId { get; set; }
}

0 comments on commit d9193aa

Please sign in to comment.