public void CheckPermutationShoulReturnTrueOrFalseWhenGivenOneAndOtherStrings(string one, string other, bool expected) { CheckPermutation checkPermutation = new CheckPermutation(); bool actual = checkPermutation.IsPermutation(one, other); Assert.Equal(expected, actual); }
public void RunTest03() { CheckPermutation cp = new CheckPermutation(null, null); var result = cp.Run(); Assert.IsTrue(result); }
public void RunTest11() { CheckPermutation cp = new CheckPermutation("asdf", "afewfs"); var result = cp.Run(); Assert.IsFalse(result); }
public void RunTest02() { CheckPermutation cp = new CheckPermutation("", ""); var result = cp.Run(); Assert.IsTrue(result); }
public void RunTest07() { CheckPermutation cp = new CheckPermutation("cba", null); var result = cp.Run(); Assert.IsFalse(result); }
public void RunTest08() { CheckPermutation cp = new CheckPermutation("abc", "aab"); var result = cp.Run(); Assert.IsFalse(result); }
public void RunTest10() { CheckPermutation cp = new CheckPermutation("abcasdffe", "cbb"); var result = cp.Run(); Assert.IsFalse(result); }
public void CheckPermutationSolution() { foreach (var item in _expected) { Assert.Equal(item.Item3, CheckPermutation.CheckPermutationSolution(item.Item1, item.Item2)); } }
public void CheckPermutation2Test(string a, string b, bool expected) { // act var actual = CheckPermutation.IsPermutation2(a, b); // assert Assert.That(actual, Is.EqualTo(expected)); }
public void FirstTry_One_String_Is_Permutation_Of_The_Other() { string first = "abcdefgh"; string second = "fdceagbh"; bool result = new CheckPermutation().FirstTry(first, second); Assert.True(result); }
public void FirstTry_Second_Parameter_Is_Null() { string first = "abcdefgh"; string second = null; bool result = new CheckPermutation().FirstTry(first, second); Assert.False(result); }
public void FirstTry_Qty_Of_Elements_Are_Different() { string first = "abcdefgh"; string second = "abcdefg"; bool result = new CheckPermutation().FirstTry(first, second); Assert.False(result); }
public void FirstTry_One_String_Is_Not_Permutation_Of_The_Other() { string first = "abcddfgh"; string second = "abcdcfgh"; bool result = new CheckPermutation().FirstTry(first, second); Assert.False(result); }
public void FirstTry_One_String_Is_Not_Permutation_Of_The_Other_Because_Contains_a_Different_Char() { string first = "abcdefgh"; string second = "fdcmagbh"; bool result = new CheckPermutation().FirstTry(first, second); Assert.False(result); }
public void SbyteTry_Vafzamora_Second_Parameter_Is_Null() { string first = "abcdefgh"; string second = null; bool result = new CheckPermutation().SbyteTry_Vafzamora(first, second); Assert.False(result); }
static void Main(string[] args) { bool isLinkedListTest = false; bool isStringArrayTest = true; if (isLinkedListTest) { SinglyLinkedList sList = new SinglyLinkedList(); DoublyLinkList dList = new DoublyLinkList(); CircularLinkList cList = new CircularLinkList(); Random rand = new Random(); for (int i = 0; i < 10; i++) { var nodeVal = rand.Next(10, 20); sList.AddNewNode(nodeVal.ToString()); dList.AddNewNode(nodeVal.ToString()); cList.AddNewNode(nodeVal.ToString()); } sList.PrintAllNode(); sList.ReverseNode(); sList.RemoveDuplicateWithBuffer(); // sList.RemoveDuplicateWithoutBuffer(); } if (isStringArrayTest) { ShiftCharacterKpositions shiftCharacter = new ShiftCharacterKpositions(); shiftCharacter.SiftByK("abnish", 2); StringHasUniqueChar stringHasUniqueChar = new StringHasUniqueChar(); stringHasUniqueChar.StringHasUniqueCharacter("aba"); CheckPermutation checkPermutation = new CheckPermutation(); checkPermutation.CheckStringPermutation("abnish", "shabnI"); ReplaceSpace replaceSpace = new ReplaceSpace(); replaceSpace.ReplaceSpaceWithPercent20("abnish kumar choudhary "); OneAwayString oneAwayString = new OneAwayString(); oneAwayString.CheckOneAwayString("abnish", "abnis"); oneAwayString.CheckOneAwayString("abnish", "abnish"); oneAwayString.CheckOneAwayString("abnish", "sanjeet"); } Console.ReadKey(); }
public void CheckPermutationWithoutSortTest(string inputOne, string inputTwo, bool expectedResult) { var result = CheckPermutation.RunWithoutSort(inputOne, inputTwo); Assert.Equal(expectedResult, result); }
public void Given_Two_Strings_Where_One_String_Is_Not_A_Permutation_Of_The_First_IsPermutation_Returns_False(string s, string ss) { var actual = CheckPermutation.IsPermutation(s, ss); Assert.False(actual); }
public void IsPermutation() { Assert.AreEqual(CheckPermutation.IsPermutation(original, permutation), true); Assert.AreEqual(CheckPermutation.IsPermutation(original, notPermutation), false); }
public void TestPermutationsCheck(string source, string target, bool result) { Assert.Equal(result, CheckPermutation.Check(source, target)); }
public void Test5() { var actual = CheckPermutation.IsPermutation("test111111", "111111tset"); Assert.IsTrue(actual); }
public void Test4() { var actual = CheckPermutation.IsPermutation("test", "tset"); Assert.IsTrue(actual); }
public void Test6() { var actual = CheckPermutation.IsPermutation("test111111", "111112tset"); Assert.IsFalse(actual); }
public void InitCheckPermutation() { _perms = new CheckPermutation(); }
public void Setup() { checkPermutation = new CheckPermutation(); }
public void CheckPermutationUsingSorting_Tests() { CheckPermutation.CheckPermutationUsingSorting("adasdasdasd", "adasdasdasda").Should().BeFalse(); CheckPermutation.CheckPermutationUsingSorting("adasdasdasd", "adasdasdasd").Should().BeTrue(); }
public void Test3() { var actual = CheckPermutation.IsPermutation("test", "tess"); Assert.IsFalse(actual); }