-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
36 additions
and
4 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
src/HeboTech.ATLib.Tests/Events/UssdResponseEventArgsTests.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,32 @@ | ||
using HeboTech.ATLib.Events; | ||
using Xunit; | ||
|
||
namespace HeboTech.ATLib.Tests.Events | ||
{ | ||
public class UssdResponseEventArgsTests | ||
{ | ||
[Fact] | ||
public void CreateFromResponse_accepts_singleline_response() | ||
{ | ||
string response = "+CUSD: 1,\"Single line response\",15"; | ||
|
||
UssdResponseEventArgs dut = UssdResponseEventArgs.CreateFromResponse(response); | ||
|
||
Assert.Equal(1, dut.Status); | ||
Assert.Equal("Single line response", dut.Response); | ||
Assert.Equal(15, dut.CodingScheme); | ||
} | ||
|
||
[Fact] | ||
public void CreateFromResponse_accepts_multiline_response() | ||
{ | ||
string response = "+CUSD: 1,\"Line1\r\nLine 2\r\nLine 3\r\nLine 4\r\nLine 5\r\nLine 6\r\nLine 7\",15"; | ||
|
||
UssdResponseEventArgs dut = UssdResponseEventArgs.CreateFromResponse(response); | ||
|
||
Assert.Equal(1, dut.Status); | ||
Assert.Equal("Line1\r\nLine 2\r\nLine 3\r\nLine 4\r\nLine 5\r\nLine 6\r\nLine 7", dut.Response); | ||
Assert.Equal(15, dut.CodingScheme); | ||
} | ||
} | ||
} |
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