-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
option to update sms send status with only gateway ref (#444)
* update sms operation based on gatewayref only * added unit test * added unit tests * simplified test
- Loading branch information
Showing
5 changed files
with
81 additions
and
10 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
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
35 changes: 35 additions & 0 deletions
35
...ltinn.Notifications.Tests/Notifications.Core/TestingModels/SmsSendOperationResultTests.cs
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,35 @@ | ||
using Altinn.Notifications.Core.Models.Notification; | ||
|
||
using Xunit; | ||
|
||
namespace Altinn.Notifications.Tests.Notifications.Core.TestingModels | ||
{ | ||
public class SmsSendOperationResultTests | ||
{ | ||
[Fact] | ||
public void TryParse_ValidInput_ReturnsTrue() | ||
{ | ||
// Arrange | ||
string input = "{\"notificationId\":\"d3b3f3e3-3e3b-3b3b-3b3b-3b3b3b3b3b3b\",\"gatewayReference\":\"123456789\",\"sendResult\":1}"; | ||
|
||
// Act | ||
bool result = SmsSendOperationResult.TryParse(input, out _); | ||
|
||
// Assert | ||
Assert.True(result); | ||
} | ||
|
||
[Fact] | ||
public void TryParse_ValidInput_NoNotificationId_ReturnsTrue() | ||
{ | ||
// Arrange | ||
string input = "{\"gatewayReference\":\"123456789\",\"sendResult\":1}"; | ||
|
||
// Act | ||
bool result = SmsSendOperationResult.TryParse(input, out _); | ||
|
||
// Assert | ||
Assert.True(result); | ||
} | ||
} | ||
} |