public void Should_ReturnFalse_When_StringHasNoLetters() { // [arrange] var input = " "; var underTest = new PalindromePermutation(); // [act] var result = underTest.HasPermutationsThatArePalindrome(input); // [assert] Assert.False(result); }
public void Should_ReturnFalse_When_NoPermutationIsAPalindrome() { // [arrange] var input = "no permutations of this are a palindrome"; var underTest = new PalindromePermutation(); // [act] var result = underTest.HasPermutationsThatArePalindrome(input); // [assert] Assert.False(result); }
static void Main(string[] args) { var condition = true; //just keeping the current solving problem in if condition; nothing else if (condition) { KStacks.MainMethod(); } else { #region LinkedLists LinkIntersection.MainMethod(); SumList.MainMethod(); RemoveDups <int> .MainMethod(); ReturnKthToLast.MainMethod(1); DeleteMiddleNode.MainMethod(); LoopDetection.MainMethod(); #endregion #region Array and Strings StringRotation.IsStringRotation("waterbottle", "erbottlewat"); ZeroMatrixImplementation(); RotateMatrixImplementation(4); StringCompression.CompressedString("aabcccccaaa"); OneAway.IsStringOneAway("pale", "paled"); PalindromePermutation.IsPalindromePermutation("Mr. owl ate my Metal worm"); URLify.URLifyString("Spaces in this string will be replaced by percent20"); IsStringPermutation.VerifyStringPermutation("abdcdefgh", "aefgb2cdh"); UniqueString.VerifyUniqueStringAsciiSet("!@#$%$^&*()EFgh"); HashTableImplentation(); SwapWithoutTemp.SwapWithoutTempVar(12, 24); #endregion } }
public void Test_NotPalindromePermutation_Success(string input) { var actual = PalindromePermutation.IsPalindromePermutation(input); Assert.IsFalse(actual); }
public void TestPalindromePermutations(string source, bool isPalindrome) { Assert.Equal(isPalindrome, PalindromePermutation.Execute(source)); }
[TestCase("superdupers 12 345 6 ' $%", true)] // still a palindrome permutation as non letters are ignored public void Test_IsPermutation(string input, bool expected) { var actual = PalindromePermutation.IsPermutation(input); Assert.That(actual, Is.EqualTo(expected)); }
public void PalindromePermutation_Test() { PalindromePermutation.PalindromePermutationAlgo("TactCoa").Should().BeTrue(); PalindromePermutation.PalindromePermutationAlgo("TactCoaa").Should().BeFalse(); PalindromePermutation.PalindromePermutationAlgo("xReowtaoraewX").Should().BeTrue(); }
public void PalindromePermutationTest(string input, bool expectedResult) { var result = PalindromePermutation.Run(input); Assert.Equal(expectedResult, result); }
public void shouldReturnTrueWhenLengthRemovingSpacesIsOddAndOnlyOneCharacterCountIsOdd() { string permutation = "a bc dcb a"; Assert.True(PalindromePermutation.IsPalindromePermutation(permutation)); }
public void shouldReturnFalseWhenLengthRemovingSpacesIsOddAndThereIsNotOneOddCharacterCounts() { string permutation = "a b ccbacb"; Assert.False(PalindromePermutation.IsPalindromePermutation(permutation)); }
public void Setup() { palindromePermutation = new PalindromePermutation(); }
public void Given_A_Palindrome_And_Permutation_CheckPalindromePermutation_Returns_True(string s, string p) { var actual = PalindromePermutation.CheckPalindromePermutation(s, p); Assert.True(actual); }