示例#1
0
        public void Code_EmptyText_Exception()
        {
            ShanFano shanFano = new ShanFano();

            string text = "";

            Assert.Throws <Exception>(() => shanFano.GetEncodedString(text));
        }
示例#2
0
        public void Decode_PlainText_GetSourceText()
        {
            ShanFano shanFano = new ShanFano();

            string text = "V bikini";

            string code = shanFano.GetEncodedString(text);

            string deCode = shanFano.GetDecodingString(code);

            Assert.AreEqual(text, deCode);
        }
示例#3
0
        public void Code_PlainText_GetCode()
        {
            ShanFano shanFano = new ShanFano();

            string text = "Biba i boba";

            string expected = "1001110100101111101011100100";

            string code = shanFano.GetEncodedString(text);

            Assert.AreEqual(code, expected);
        }