public void RunTest05() { OneAway test = new OneAway("payles", "pale"); var result = test.Run(); Assert.IsFalse(result); }
public void RunTest03() { OneAway test = new OneAway("pale", "bale"); var result = test.Run(); Assert.IsTrue(result); }
public void OneAwayAlgoTests() { OneAway.OneAwayAlgo("pale", "ple").Should().BeTrue(); OneAway.OneAwayAlgo("pales", "pale").Should().BeTrue(); OneAway.OneAwayAlgo("pale", "bale").Should().BeTrue(); OneAway.OneAwayAlgo("pale", "bake").Should().BeFalse(); }
public void FirstTry_Equal_Parameters_Returns_True() { string first = "pale"; string second = "pale"; bool result = new OneAway().FirstTry(first, second); Assert.True(result); }
public void FirstTry_Parameters_PALE_and_BAE_Returns_False() { string first = "pale"; string second = "bae"; bool result = new OneAway().FirstTry(first, second); Assert.False(result); }
public void Fast_Parameters_PALE_and_BALE_Returns_True() { string first = "pale"; string second = "bale"; bool result = new OneAway().Fast(first, second); Assert.True(result); }
public void TestOneAway() { // solution #1 Assert.True(OneAway.OneAwayEdit("pale", "ple")); Assert.True(OneAway.OneAwayEdit("pales", "pale")); Assert.True(OneAway.OneAwayEdit("pale", "bale")); Assert.False(OneAway.OneAwayEdit("pale", "bae")); // solution #2 Assert.True(OneAway.OneAwayEditWhole("pale", "ple")); Assert.True(OneAway.OneAwayEditWhole("pales", "pale")); Assert.True(OneAway.OneAwayEditWhole("pale", "bale")); Assert.False(OneAway.OneAwayEditWhole("pale", "bae")); }
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 OneAwayTest(string inputOne, string inputTwo, bool expectedResult) { var result = OneAway.Run(inputOne, inputTwo); Assert.Equal(expectedResult, result); }
public void TestOneAway(string first, string second, bool expected) { Assert.Equal(expected, OneAway.Execute(first, second)); }
public void Given_Two_Strings_And_One_String_Is_Not_One_Away_From_The_Other_CheckOneAway_Returns_False(string s, string t) { var actual = OneAway.CheckOneAway(s, t); Assert.False(actual, string.Format(@"for values '{0}' and '{1}' CheckOneAway should return false", s, t)); }
public void Test_OneAway(string a, string b, bool expected) { var actual = OneAway.IsOneAway(a, b); Assert.That(actual, Is.EqualTo(expected)); }
public void Setup() { oneAway = new OneAway(); }