From 9986270bed71dac3205d337a9ba4c82b6c6b617c Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Tue, 1 Nov 2016 01:33:26 +0800 Subject: [PATCH] Fix typo "CpdeToAuthenticate" -> CodeToAuthenticate And let's use nameof() in all cases so this doesn't happen again. --- TLSharp.Tests/TLSharpTests.cs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/TLSharp.Tests/TLSharpTests.cs b/TLSharp.Tests/TLSharpTests.cs index 2e2ba0e..8e6a604 100644 --- a/TLSharp.Tests/TLSharpTests.cs +++ b/TLSharp.Tests/TLSharpTests.cs @@ -60,43 +60,45 @@ namespace TLSharp.Tests private void GatherTestConfiguration() { + string appConfigMsgWarning = "{0} not configured in app.config! Some tests may fail."; + ApiHash = ConfigurationManager.AppSettings[nameof(ApiHash)]; if (string.IsNullOrEmpty(ApiHash)) - Debug.WriteLine("ApiHash not configured in app.config! Some tests may fail."); + Debug.WriteLine(appConfigMsgWarning, nameof(ApiHash)); var apiId = ConfigurationManager.AppSettings[nameof(ApiId)]; if (string.IsNullOrEmpty(apiId)) - Debug.WriteLine("ApiId not configured in app.config! Some tests may fail."); + Debug.WriteLine(appConfigMsgWarning, nameof(ApiId)); else ApiId = int.Parse(apiId); NumberToAuthenticate = ConfigurationManager.AppSettings[nameof(NumberToAuthenticate)]; if (string.IsNullOrEmpty(NumberToAuthenticate)) - Debug.WriteLine("NumberToAuthenticate not configured in app.config! Some tests may fail."); + Debug.WriteLine(appConfigMsgWarning, nameof(NumberToAuthenticate)); CodeToAuthenticate = ConfigurationManager.AppSettings[nameof(CodeToAuthenticate)]; if (string.IsNullOrEmpty(CodeToAuthenticate)) - Debug.WriteLine("CpdeToAuthenticate not configured in app.config! Some tests may fail."); + Debug.WriteLine(appConfigMsgWarning, nameof(CodeToAuthenticate)); NotRegisteredNumberToSignUp = ConfigurationManager.AppSettings[nameof(NotRegisteredNumberToSignUp)]; if (string.IsNullOrEmpty(NotRegisteredNumberToSignUp)) - Debug.WriteLine("NotRegisteredNumberToSignUp not configured in app.config! Some tests may fail."); + Debug.WriteLine(appConfigMsgWarning, nameof(NotRegisteredNumberToSignUp)); NumberToSendMessage = ConfigurationManager.AppSettings[nameof(NumberToSendMessage)]; if (string.IsNullOrEmpty(NumberToSendMessage)) - Debug.WriteLine("NumberToSendMessage not configured in app.config! Some tests may fail."); + Debug.WriteLine(appConfigMsgWarning, nameof(NumberToSendMessage)); UserNameToSendMessage = ConfigurationManager.AppSettings[nameof(UserNameToSendMessage)]; if (string.IsNullOrEmpty(UserNameToSendMessage)) - Debug.WriteLine("UserNameToSendMessage not configured in app.config! Some tests may fail."); + Debug.WriteLine(appConfigMsgWarning, nameof(UserNameToSendMessage)); NumberToGetUserFull = ConfigurationManager.AppSettings[nameof(NumberToGetUserFull)]; if (string.IsNullOrEmpty(NumberToGetUserFull)) - Debug.WriteLine("NumberToGetUserFull not configured in app.config! Some tests may fail."); + Debug.WriteLine(appConfigMsgWarning, nameof(NumberToGetUserFull)); NumberToAddToChat = ConfigurationManager.AppSettings[nameof(NumberToAddToChat)]; if (string.IsNullOrEmpty(NumberToAddToChat)) - Debug.WriteLine("NumberToAddToChat not configured in app.config! Some tests may fail."); + Debug.WriteLine(appConfigMsgWarning, nameof(NumberToAddToChat)); } [TestMethod]