Example #1
0
        public void CharAtTest()
        {
            const string text     = "one";
            var          alphabet = new Alphabet(text);

            for (int i = 0; i < text.Length; i++)
            {
                Assert.AreEqual(text[i], alphabet.CharAt(i));
            }
        }
Example #2
0
        public void AbsobtionTest()
        {
            const string text     = "one";
            var          alphabet = new Alphabet(text);

            for (int i = 0; i < text.Length; i++)
            {
                Assert.AreEqual(i, alphabet.IndexOf(alphabet[i]));
                Assert.AreEqual(text[i], alphabet.CharAt(
                                    alphabet.IndexOf(text[i])));
            }
        }
Example #3
0
        public void DistinctTest()
        {
            const string text     = "test";
            var          alphabet = new Alphabet(text);

            var distinctText = text.Distinct().ToList();

            for (int i = 0; i < distinctText.Count; i++)
            {
                Assert.AreEqual(distinctText[i], alphabet.CharAt(i));
            }
        }