CheckCellTests.ErrorGeneratorTests.TestTypoGenerator C# (CSharp) Method

TestTypoGenerator() private method

private TestTypoGenerator ( ) : void
return void
        public void TestTypoGenerator()
        {
            var eg = new ErrorGenerator();
            var classification = new Classification();

            //set typo dictionary to explicit one
            Dictionary<Tuple<OptChar, string>, int> typo_dict = new Dictionary<Tuple<OptChar, string>, int>();

            var key = new Tuple<OptChar, string>(OptChar.Some('t'), "y");
            typo_dict.Add(key, 1);

            key = new Tuple<OptChar, string>(OptChar.Some('t'), "t");
            typo_dict.Add(key, 0);

            key = new Tuple<OptChar, string>(OptChar.Some('T'), "TT");
            typo_dict.Add(key, 1);

            key = new Tuple<OptChar, string>(OptChar.Some('e'), "e");
            typo_dict.Add(key, 1);

            key = new Tuple<OptChar, string>(OptChar.Some('s'), "s");
            typo_dict.Add(key, 1);

            //The transpositions dictionary is empty so no transpositions should occur
            classification.SetTypoDict(typo_dict);
            var s = eg.GenerateErrorString("Testing", classification);
            Assert.AreEqual("TTesying", s);
        }