コード例 #1
0
ファイル: DecodeTests.cs プロジェクト: Heavy32/Katas
        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);
        }
コード例 #2
0
        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);
        }