Skip to content

Commit

Permalink
fix: rename MessagePart -> NumberOfParts and change type string -> int (
Browse files Browse the repository at this point in the history
#91)

* fix: rename MessagePart -> NumberOfParts and change type string -> int
  • Loading branch information
Dovchik authored Oct 22, 2024
1 parent 4e547a2 commit 49d53ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Sinch/SMS/Batches/DryRun/DryRunResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class PerRecipient
{
public string? Recipient { get; set; }

public string? MessagePart { get; set; }
public int? NumberOfParts { get; set; }

public string? Body { get; set; }

Expand Down
13 changes: 11 additions & 2 deletions tests/Sinch.Tests/Sms/BatchesTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Json;
Expand Down Expand Up @@ -241,8 +242,8 @@ public async Task DryRun()
number_of_messages = 50,
per_recipient = new[]
{
new { recipient = "a", message_part = "b", body = "c", encoding = "g" },
new { recipient = "a", message_part = "b", body = "c", encoding = "g" }
new { recipient = "a", body = "c", encoding = "UTF-8", number_of_parts = 1 },
new { recipient = "a", body = "c", encoding = "UTF-8", number_of_parts = 3 }
}
}));

Expand Down Expand Up @@ -270,6 +271,14 @@ public async Task DryRun()
response.PerRecipient.Should().HaveCount(2);
response.NumberOfMessages.Should().Be(50);
response.NumberOfRecipients.Should().Be(5);

response.PerRecipient!.First().Should().BeEquivalentTo(new PerRecipient()
{
Body = "c",
Recipient = "a",
NumberOfParts = 1,
Encoding = "UTF-8"
});
}

[Fact]
Expand Down

0 comments on commit 49d53ac

Please sign in to comment.