Esempio n. 1
0
        public void SameStringTest()
        {
            var s              = "abcdefg";
            var correlater     = new PatienceDiffCorrelater <char>();
            var expectedResult = new CorrelaterResult <char>(0, s.ToCharArray(), s.ToCharArray());

            correlater.AssertComparision(s, s, expectedResult);
        }
Esempio n. 2
0
        public void TotallyDifferentStrings()
        {
            var s1             = "abcdefg";
            var s2             = "1234567";
            var correlater     = new PatienceDiffCorrelater <char>();
            var expectedResult = new CorrelaterResult <char>(14, "abcdefg\0\0\0\0\0\0\0".ToCharArray(), "\0\0\0\0\0\0\01234567".ToCharArray());

            correlater.AssertComparision(s1, s2, expectedResult);
        }
Esempio n. 3
0
        public void DifferentCharTest()
        {
            var s1             = "abc1efg";
            var s2             = "abc2efg";
            var correlater     = new PatienceDiffCorrelater <char>();
            var expectedResult = new CorrelaterResult <char>(2, "abc1\0efg".ToCharArray(), "abc\02efg".ToCharArray());

            correlater.AssertComparision(s1, s2, expectedResult);
        }
Esempio n. 4
0
        public void TwoAddedCharsInStringsTest()
        {
            var s1             = "abcfg";
            var s2             = "abcdefg";
            var correlater     = new PatienceDiffCorrelater <char>();
            var expectedResult = new CorrelaterResult <char>(2, "abc\0\0fg".ToCharArray(), s2.ToCharArray());

            correlater.AssertComparision(s1, s2, expectedResult);
        }
Esempio n. 5
0
        public void OneRemovedCharInStringsTest()
        {
            var s1             = "abcdefg";
            var s2             = "abcefg";
            var correlater     = new PatienceDiffCorrelater <char>();
            var expectedResult = new CorrelaterResult <char>(1, s1.ToCharArray(), "abc\0efg".ToCharArray());

            correlater.AssertComparision(s1, s2, expectedResult);
        }
Esempio n. 6
0
        public void ComplexString2()
        {
            var s1             = "1ya9az888b2";
            var s2             = "2ya7az6b4";
            var correlater     = new PatienceDiffCorrelater <char>();
            var expectedResult = new CorrelaterResult <char>(10, "1\0ya9\0az888\0b2\0".ToCharArray(), "\02ya\07az\0\0\06b\04".ToCharArray());

            correlater.AssertComparision(s1, s2, expectedResult);
        }
Esempio n. 7
0
        public void SameStringInTheMiddle()
        {
            var s1             = "123abc456";
            var s2             = "78abc";
            var correlater     = new PatienceDiffCorrelater <char>();
            var expectedResult = new CorrelaterResult <char>(8, "123\0\0abc456".ToCharArray(), "\0\0\078abc\0\0\0".ToCharArray());

            correlater.AssertComparision(s1, s2, expectedResult);
        }
Esempio n. 8
0
        public void DifferentStart()
        {
            var s1             = "123abc";
            var s2             = "78abc";
            var correlater     = new PatienceDiffCorrelater <char>();
            var expectedResult = new CorrelaterResult <char>(5, "123\0\0abc".ToCharArray(), "\0\0\078abc".ToCharArray());

            correlater.AssertComparision(s1, s2, expectedResult);
        }
Esempio n. 9
0
        public void OneElementTheSame()
        {
            var s1             = "1a3";
            var s2             = "5a6";
            var correlater     = new PatienceDiffCorrelater <char>();
            var expectedResult = new CorrelaterResult <char>(4, "1\0a3\0".ToCharArray(), "\05a\06".ToCharArray());

            correlater.AssertComparision(s1, s2, expectedResult);
        }
Esempio n. 10
0
        public void EndTheSame()
        {
            var s1             = "1a";
            var s2             = "5a";
            var correlater     = new PatienceDiffCorrelater <char>();
            var expectedResult = new CorrelaterResult <char>(2, "1\0a".ToCharArray(), "\05a".ToCharArray());

            correlater.AssertComparision(s1, s2, expectedResult);
        }