Skip to content

Commit

Permalink
SendMessageTest: rather crash with meaningful exception
Browse files Browse the repository at this point in the history
Rather crash with meaningful exception than not passing the
test and only giving a hint when debugging.
  • Loading branch information
knocte committed Nov 2, 2016
1 parent 8b04f82 commit 738a849
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions TLSharp.Tests/TLSharpTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ private void GatherTestConfiguration()
if (string.IsNullOrEmpty(NotRegisteredNumberToSignUp))
Debug.WriteLine(appConfigMsgWarning, nameof(NotRegisteredNumberToSignUp));

NumberToSendMessage = ConfigurationManager.AppSettings[nameof(NumberToSendMessage)];
if (string.IsNullOrEmpty(NumberToSendMessage))
Debug.WriteLine(appConfigMsgWarning, nameof(NumberToSendMessage));

UserNameToSendMessage = ConfigurationManager.AppSettings[nameof(UserNameToSendMessage)];
if (string.IsNullOrEmpty(UserNameToSendMessage))
Debug.WriteLine(appConfigMsgWarning, nameof(UserNameToSendMessage));
Expand Down Expand Up @@ -134,6 +130,10 @@ public async Task AuthUser()
[TestMethod]
public async Task SendMessageTest()
{
NumberToSendMessage = ConfigurationManager.AppSettings[nameof(NumberToSendMessage)];
if (string.IsNullOrWhiteSpace(NumberToSendMessage))
throw new Exception($"Please fill the '{nameof(NumberToSendMessage)}' setting in app.config file first");

var client = NewClient();

await client.ConnectAsync();
Expand Down

0 comments on commit 738a849

Please sign in to comment.