public void AttemptToDecode_InvalidShortCode() { List <string> inputList = new List <string>() { "ag4j!", "asd-b", "zzzA", "hhh}j", "aBc3ff", "`fbse", "?hopd", "'gwno", "$bdf", "bs+4d", "-bar", "foo|", }; inputList.Add("000!"); inputList.Add("zzzA"); inputList.Add("hhh}"); inputList.Add("abc/"); foreach (var input in inputList) { int testOutput = UrlMinimizer.Decode(input); Assert.AreEqual(-1, testOutput); Console.WriteLine(string.Format("Successfully processed string: {0} - Returned: {1}", input, testOutput.ToString())); } }
public void AttemptToDecode_ShortCodeStringTooLong() { string testInput = "0000000"; int testOutput = UrlMinimizer.Decode(testInput); Assert.AreEqual(-1, testOutput); }
public void AttemptToDecode_AboveValidShortCodeValues() { string testInput = "zzzzzz"; int testOutput = UrlMinimizer.Decode(testInput); Assert.AreEqual(-1, testOutput); }
public void Decode_HighestestValidShortCodeValue() { string testInput = "zik0zj"; int testOutput = UrlMinimizer.Decode(testInput); Assert.AreEqual(2147392738, testOutput); }
public void Decode_LowestValidShortCodeValue() { string testInput = "1y5a"; int testOutput = UrlMinimizer.Decode(testInput); Assert.AreEqual(1, testOutput); }