public void AlphabetTest() { Assert.AreEqual("nopqrstuvwxyzabcdefghijklm", KataRot13.Rot13("abcdefghijklmnopqrstuvwxyz"), String.Format( "Input: abcdefghijklmnopqrstuvwxyz, Expected Output: nopqrstuvwxyzabcdefghijklm, Actual Output: {0}", KataRot13.Rot13("abcdefghijklmnopqrstuvwxyz"))); }
public void RandomTest() { const int Tests = 100; for (int i = 0; i < Tests; ++i) { string test = String.Concat(new char[50].Select(_ => (rnd.Next(0, 6) == 0) ? (char)rnd.Next(32, 127) : (rnd.Next(0, 2) == 0) ? (char)rnd.Next(65, 91) : (char)rnd.Next(97, 123))); string actual = KataRot13.Rot13(test); string expected = solution(test); Assert.AreEqual(expected, actual, String.Format("Input: {0}, Expected Output: {1}, Actual Output: {2}", test, expected, actual)); } }
public void ArithTest() { Assert.AreEqual("10+2 vf gjryir.", KataRot13.Rot13("10+2 is twelve."), String.Format("Input: Codewars, Expected Output: 10+2 vf gjryir., Actual Output: {0}", KataRot13.Rot13("10+2 is twelve."))); }
public void CSTest() { Assert.AreEqual("P# vf pbby!", KataRot13.Rot13("C# is cool!"), String.Format("Input: C# is cool!, Expected Output: P# vf pbby!, Actual Output: {0}", KataRot13.Rot13("C# is cool!"))); }
public void CodewarsTest() { Assert.AreEqual("Pbqrjnef", KataRot13.Rot13("Codewars"), String.Format("Input: Codewars, Expected Output: Pbqrjnef, Actual Output: {0}", KataRot13.Rot13("Codewars"))); }
public void TestTest() { Assert.AreEqual("Grfg", KataRot13.Rot13("Test"), String.Format("Input: Test, Expected Output: Grfg, Actual Output: {0}", KataRot13.Rot13("Test"))); }