Skip to content

Commit

Permalink
Fix bug and coordinate sms-constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
tba76 committed Jan 25, 2024
1 parent d3625bf commit 21ecd4b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/Altinn.Notifications.Sms.Core/Sending/Sms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ public class Sms
/// </summary>
public Guid NotificationId { get; set; }

/// <summary>
/// Gets or sets the recipient of the sms message
/// </summary>
public string Recipient { get; set; } = string.Empty;

/// <summary>
/// Gets or sets the sender of the sms message
/// </summary>
Expand All @@ -25,6 +20,11 @@ public class Sms
/// </remarks>
public string Sender { get; set; } = string.Empty;

/// <summary>
/// Gets or sets the recipient of the sms message
/// </summary>
public string Recipient { get; set; } = string.Empty;

/// <summary>
/// Gets or sets the contents of the sms message
/// </summary>
Expand All @@ -33,7 +33,7 @@ public class Sms
/// <summary>
/// Initializes a new instance of the <see cref="Sms"/> class.
/// </summary>
public Sms(Guid notificationId, string recipient, string sender, string message)
public Sms(Guid notificationId, string sender, string recipient, string message)
{
NotificationId = notificationId;
Recipient = recipient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public SmsClient(IAltinnGatewayClient client)
/// <inheritdoc />
public async Task<Result<string, SmsClientErrorResponse>> SendAsync(Core.Sending.Sms sms)
{
MessageResult result = await _client.SendAsync(new LinkMobilityModel.Sms(sms.Recipient, sms.Message, sms.Sender));
MessageResult result = await _client.SendAsync(new LinkMobilityModel.Sms(sms.Sender, sms.Recipient, sms.Message));

if (result.IsStatusOk)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public async Task ConsumeSmsTest_Successfull_deserialization_of_message_Service_
var sendingServiceMock = new Mock<ISendingService>();
sendingServiceMock.Setup(s => s.SendAsync(It.IsAny<Core.Sending.Sms>())).Returns(Task.CompletedTask);

Core.Sending.Sms sms = new(Guid.NewGuid(), "recipient", "sender", "message");
Core.Sending.Sms sms = new(Guid.NewGuid(), "sender", "recipient", "message");

using SendSmsQueueConsumer queueConsumer = GetSmsSendingConsumer(sendingServiceMock.Object);
using CommonProducer commonProducer = KafkaUtil.GetKafkaProducer(_serviceProvider!);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public async Task SendAsync_GatewayReferenceGenerated_PublishedToExpectedKafkaTo
{
// Arrange
Guid id = Guid.NewGuid();
Notifications.Sms.Core.Sending.Sms sms = new(id, "recipient", "sender", "message");
Notifications.Sms.Core.Sending.Sms sms = new(id, "sender", "recipient", "message");

Mock<ISmsClient> clientMock = new();
clientMock.Setup(c => c.SendAsync(It.IsAny<Notifications.Sms.Core.Sending.Sms>()))
Expand All @@ -50,7 +50,7 @@ public async Task SendAsync_InvalidReceiver_PublishedToExpectedKafkaTopic()
{
// Arrange
Guid id = Guid.NewGuid();
Notifications.Sms.Core.Sending.Sms sms = new(id, "recipient", "sender", "message");
Notifications.Sms.Core.Sending.Sms sms = new(id, "sender", "recipient", "message");

Mock<ISmsClient> clientMock = new();
clientMock.Setup(c => c.SendAsync(It.IsAny<Notifications.Sms.Core.Sending.Sms>()))
Expand Down

0 comments on commit 21ecd4b

Please sign in to comment.