public void DecodeTest() { IterativeRotationCipher cipher = new IterativeRotationCipher("10 hu fmo a,ys vi utie mr snehn rni tvte .ysushou teI fwea pmapi apfrok rei tnocsclet", 10); string expected = "If you wish to make an apple pie from scratch, you must first invent the universe."; string actual = cipher.Decode(); Assert.AreEqual(expected, actual); }
public void ReturnSpaces() { IterativeRotationCipher cipher = new IterativeRotationCipher("You are my friend, how are you doing?", 10); string expected = "You are my friend, how are you doing?"; /*Youaremyfriend,howareyoudoing? * You aremyfriend,howareyoudoing? * */ cipher.WriteSpacePositions(); cipher.inputText = Regex.Replace(cipher.inputText, @"\s+", ""); cipher.ReturnSpaces(); Assert.AreEqual(expected, cipher.inputText); }