Ad
  • Custom User Avatar

    For various reasons, parametrized test suites and test cases are not commonly used on Codewars. One of them might be that authors usualy mimic what they've seen in other kata without knowing about many interesting features of testing frameworks. Another thing is that not many testing tools support parametrization of tests, and as a result, such techniques do not find their way to tests based on NUnit or JUnit. Assertions in a loop are a very common pattern which could be replaced by test case generators with a great effect.

    It could also have some drawbacks though, because Codewars might have some problems supporting more complex ways of organizing tests.

    That being said, for majority of test suites you are able to check what are the inputs of a failing test: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution#how-can-i-see-which-input-causes-my-solution-to-fail .

  • Custom User Avatar

    Nice Kata :-)

    The only suggestion I have is to write the tests using the TestCaseAttribute. Rather than breaking on the first failed test, it runs all the tests and you can clearly see which ones fail.

    It will look like this:

      [TestCase("AZ", ExpectedResult = "A                         Z")]
      [TestCase("ABC", ExpectedResult = "A B C")]
      [TestCase("ACE", ExpectedResult = "A  C  E")]
      [TestCase("CBA", ExpectedResult = "  A")]
      [TestCase("HELLOWORLD", ExpectedResult = "     E H    DLL   OLO   R  W")]
      public string BasicTests(string input)
      {
          return Kata.Speedify(input);
      }
    
  • Custom User Avatar

    Please use spoiler flag next time.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution