public void TestWithNull() { string[] request = null; Dictionary <string, string> result = CommandLineFunctions.GetCommandLineParameters(request); Assert.AreEqual(0, result.Count); }
public void TestWithOneBadParameter() { string[] request = new string[] { "1212" }; Dictionary <string, string> result = CommandLineFunctions.GetCommandLineParameters(request); Assert.AreEqual(0, result.Count); }
public void TestWithThreeBadParameters() { string[] request = new string[] { "1212", "847tyhperuogij", "9w874r78u8ijogrek", }; Dictionary <string, string> result; result = CommandLineFunctions.GetCommandLineParameters(request); Assert.AreEqual(0, result.Count); }
public static void Init(StartupEventArgs startupEventArgs) { KeyValuePair <string, string> item; Dictionary <string, string> commandLineParameters = new Dictionary <string, string>(); // commandLineParameters = CommandLineFunctions.GetCommandLineParameters(startupEventArgs); // Locale item = commandLineParameters.Where(x => x.Key == "locale").FirstOrDefault(); if (item.Key != null && item.Value != null) { CoreData.RequestedLocale = item.Value; } }
public void TestWithStrangKeyNames() { string[] request = new string[] { "&^*^%=!@#@#!", "!======" }; Dictionary <string, string> expectedResult = new Dictionary <string, string>() { { "&^*^%", "!@#@#!" }, { "!", "=====" } }; Dictionary <string, string> result = CommandLineFunctions.GetCommandLineParameters(request); CollectionAssert.AreEqual(expectedResult, result); }
public void TestWithOneBadAndOneGoodParameter() { string[] request = new string[] { "1212", "x=x" }; Dictionary <string, string> expectedResult = new Dictionary <string, string>() { { "x", "x" } }; Dictionary <string, string> result; result = CommandLineFunctions.GetCommandLineParameters(request); CollectionAssert.AreEqual(expectedResult, result); }
public void TestWithKeyNameWithSpace() { string[] request = new string[] { "1 =1212", "222 =847tyhperuogij", " iwrjiowjrtw ==9w874r78u8ijogrek", " test =key1=z1=z2", }; Dictionary <string, string> expectedResult = new Dictionary <string, string>() { { "1", "1212" }, { "222", "847tyhperuogij" }, { "iwrjiowjrtw", "=9w874r78u8ijogrek" }, { "test", "key1=z1=z2" } }; Dictionary <string, string> result = CommandLineFunctions.GetCommandLineParameters(request); CollectionAssert.AreEqual(expectedResult, result); }