Beispiel #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"));
 }
Beispiel #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"));
 }
Beispiel #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));
     }
 }
Beispiel #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));
 }
Beispiel #6
0
 public void IsDistinct()
 {
     Assert.AreEqual("abcdx", TwoToOne.sortLetter("bbac", "xxcdd"));
 }
Beispiel #7
0
 public void TestMethod1()
 {
     Assert.AreEqual("abc", TwoToOne.sortLetter("abc", "abc"));
 }
Beispiel #8
0
 public void IsTwoToOne_NotEqual_ReturnFalsee(string actual, string testA, string testB)
 {
     Assert.NotEqual(actual, TwoToOne.Solution(testA, testB));
 }
Beispiel #9
0
 public void IsTwoToOne_(string actual, string testA, string testB)
 {
     Assert.Equal(actual, TwoToOne.Solution(testA, testB));
 }