Fix typo "CpdeToAuthenticate" -> CodeToAuthenticate

And let's use nameof() in all cases so this doesn't happen again.
This commit is contained in:
Andres G. Aragoneses 2016-11-01 01:33:26 +08:00
parent 24a9ea1ed9
commit 9986270bed

View file

@ -60,43 +60,45 @@ namespace TLSharp.Tests
private void GatherTestConfiguration() private void GatherTestConfiguration()
{ {
string appConfigMsgWarning = "{0} not configured in app.config! Some tests may fail.";
ApiHash = ConfigurationManager.AppSettings[nameof(ApiHash)]; ApiHash = ConfigurationManager.AppSettings[nameof(ApiHash)];
if (string.IsNullOrEmpty(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)]; var apiId = ConfigurationManager.AppSettings[nameof(ApiId)];
if (string.IsNullOrEmpty(apiId)) if (string.IsNullOrEmpty(apiId))
Debug.WriteLine("ApiId not configured in app.config! Some tests may fail."); Debug.WriteLine(appConfigMsgWarning, nameof(ApiId));
else else
ApiId = int.Parse(apiId); ApiId = int.Parse(apiId);
NumberToAuthenticate = ConfigurationManager.AppSettings[nameof(NumberToAuthenticate)]; NumberToAuthenticate = ConfigurationManager.AppSettings[nameof(NumberToAuthenticate)];
if (string.IsNullOrEmpty(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)]; CodeToAuthenticate = ConfigurationManager.AppSettings[nameof(CodeToAuthenticate)];
if (string.IsNullOrEmpty(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)]; NotRegisteredNumberToSignUp = ConfigurationManager.AppSettings[nameof(NotRegisteredNumberToSignUp)];
if (string.IsNullOrEmpty(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)]; NumberToSendMessage = ConfigurationManager.AppSettings[nameof(NumberToSendMessage)];
if (string.IsNullOrEmpty(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)]; UserNameToSendMessage = ConfigurationManager.AppSettings[nameof(UserNameToSendMessage)];
if (string.IsNullOrEmpty(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)]; NumberToGetUserFull = ConfigurationManager.AppSettings[nameof(NumberToGetUserFull)];
if (string.IsNullOrEmpty(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)]; NumberToAddToChat = ConfigurationManager.AppSettings[nameof(NumberToAddToChat)];
if (string.IsNullOrEmpty(NumberToAddToChat)) if (string.IsNullOrEmpty(NumberToAddToChat))
Debug.WriteLine("NumberToAddToChat not configured in app.config! Some tests may fail."); Debug.WriteLine(appConfigMsgWarning, nameof(NumberToAddToChat));
} }
[TestMethod] [TestMethod]