Exemple #1
0
 public static void test1()
 {
     Assert.AreEqual("aehrsty", TwoToOne.Longest("aretheyhere", "yestheyarehere"));
     Assert.AreEqual("abcdefghilnoprstu",
                     TwoToOne.Longest("loopingisfunbutdangerous", "lessdangerousthancoding"));
     Assert.AreEqual("acefghilmnoprstuy", TwoToOne.Longest("inmanylanguages", "theresapairoffunctions"));
 }
Exemple #2
0
 public static void TwoToOne_Longest_Test1()
 {
     Assert.AreEqual("aehrsty", TwoToOne.Longest("aretheyhere", "yestheyarehere"));
     Assert.AreEqual("abcdefghilnoprstu", TwoToOne.Longest("loopingisfunbutdangerous", "lessdangerousthancoding"));
     Assert.AreEqual("acefghilmnoprstuy", TwoToOne.Longest("inmanylanguages", "theresapairoffunctions"));
     Assert.AreEqual("adefghklmnorstu", TwoToOne.Longest("lordsofthefallen", "gamekult"));
     Assert.AreEqual("acdeorsw", TwoToOne.Longest("codewars", "codewars"));
     Assert.AreEqual("acdefghilmnorstuw", TwoToOne.Longest("agenerationmustconfrontthelooming", "codewarrs"));
 }
Exemple #3
0
 public static void TwoToOne_Longest_RandomTest()
 {
     Console.WriteLine("200 Random Tests");
     for (int i = 0; i < 200; i++)
     {
         string s1 = DoEx(rnd.Next(1, 10));
         string s2 = DoEx(rnd.Next(1, 8));
         Assert.AreEqual(LongestSol(s1, s2), TwoToOne.Longest(s1, s2));
     }
 }
Exemple #4
0
 public void LongestShouldReturnCorrectString()
 {
     AssertThatStringsAreEqual(TwoToOne.Longest("", ""), "");
     AssertThatStringsAreEqual(TwoToOne.Longest("a", ""), "a");
     AssertThatStringsAreEqual(TwoToOne.Longest("ba", ""), "ab");
     AssertThatStringsAreEqual(TwoToOne.Longest("ba", "c"), "abc");
     AssertThatStringsAreEqual(TwoToOne.Longest("ba", "b"), "ab");
     AssertThatStringsAreEqual(TwoToOne.Longest("aretheyhere", "yestheyarehere"), "aehrsty");
     AssertThatStringsAreEqual(TwoToOne.Longest("loopingisfunbutdangerous", "lessdangerousthancoding"), "abcdefghilnoprstu");
     AssertThatStringsAreEqual(TwoToOne.Longest("inmanylanguages", "theresapairoffunctions"), "acefghilmnoprstuy");
 }
 public void ShouldReturnTheOrderedDistinctCharactersOfBothStrings(string strOne, string strTwo, string expected)
 {
     Assert.Equal(expected, TwoToOne.Longest(strOne, strTwo));
 }
Exemple #6
0
 public void IsDistinct()
 {
     Assert.AreEqual("abcdx", TwoToOne.sortLetter("bbac", "xxcdd"));
 }
Exemple #7
0
 public void TestMethod1()
 {
     Assert.AreEqual("abc", TwoToOne.sortLetter("abc", "abc"));
 }
Exemple #8
0
 public void IsTwoToOne_NotEqual_ReturnFalsee(string actual, string testA, string testB)
 {
     Assert.NotEqual(actual, TwoToOne.Solution(testA, testB));
 }
Exemple #9
0
 public void IsTwoToOne_(string actual, string testA, string testB)
 {
     Assert.Equal(actual, TwoToOne.Solution(testA, testB));
 }