CheckCellTests.LCSTests.TestLeftAlignedLCS C# (CSharp) Method

TestLeftAlignedLCS() private method

private TestLeftAlignedLCS ( ) : void
return void
        public void TestLeftAlignedLCS()
        {
            var s1 = "abc";
            var s2 = "abcc";
            // this returns exactly one left-aligned common subsequence, chosen randomly
            var ss = LongestCommonSubsequence.LeftAlignedLCSList(s1, s2);

            // but in this case, both left-aligned subsequences will be the same
            Tuple<int, int>[] shouldbe = { new Tuple<int, int>(0, 0), new Tuple<int, int>(1, 1), new Tuple<int, int>(2, 2) };

            Assert.AreEqual(true, ss.SequenceEqual<Tuple<int, int>>(shouldbe));

            var s3 = "aaab";
            var s4 = "bzzzaaa";
            var ss2 = LongestCommonSubsequence.LeftAlignedLCS(s3, s4);

            Tuple<int, int>[] shouldbe2 = { new Tuple<int, int>(0, 4), new Tuple<int, int>(1, 5), new Tuple<int, int>(2, 6) };

            Assert.AreEqual(true, ss2.SequenceEqual<Tuple<int, int>>(shouldbe2));
        }