Ad
  • Default User Avatar

    Just include NUnit.Framework namespace in the TestClass.

  • Custom User Avatar

    The function isn't static in the default code. Most C# katas use static functions. This one, for reasons unknown, apparently doesn't. In any case, removing static from the code will work.
    Although, your code still won't pass because it is wrong. Maybe you should reread the description to make sure your function is doing what the kata asks for.

  • Custom User Avatar

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

  • Custom User Avatar

    How do I stop getting this error?:

    Error: Command failed: /tmp/csharp11641-19-oqtvya/fixture.cs(1,2): error CS0246: The type or namespace name TestFixture' could not be found. Are you missing NUnit.Core' using directive?
    /tmp/csharp11641-19-oqtvya/fixture.cs(4,4): error CS0246: The type or namespace name Test' could not be found. Are you missing NUnit.Core' using directive?
    /tmp/csharp11641-19-oqtvya/fixture.cs(16,57): error CS0103: The name `String' does not exist in the current context

  • Custom User Avatar

    Thanks for the help though, your remark about not seeing the using statement made me try it out in the solution box and that ended up fixing everything :)

  • Custom User Avatar

    Oh, the the double backslash must have been converted to a single one by the editor. Ayways, glad you found the problem.

  • Custom User Avatar
    1. I did use "\", if you couldnt see it then maybe i pasted the wrong thing.
    2. I didn't know about the formatting thing
    3. I found out the problem was that my using System.Linq statement was in the test cases box and it won't work that way. I had to put it in the solution box and it worked.
    using System.Linq;
    
    public class Kata
    {  
      
      public static char[] noise = { '%', '$', '&', '/', '#', '·', '@', '|', 'º', '\\', 'ª' };
      
      public static string removeNoise(string equation)
      {
        char[] sentence= equation.ToCharArray();
        string newString = "";
    
        for (int i = 0; i < sentence.Length; i++)
          {
            if (!noise.Contains<char>(sentence[i]))
            {
              newString += sentence[i];
            }
          }
        
        return newString;    
      } // end RemoveNoise method
      
    } // end class
    
  • Custom User Avatar
    • I don't see the using System.Linq; in your code. How exactly are you using it?
    • \ needs to be escaped by another \.
    • When sharing your code in a comment, you should use proper formatting, like
    ```csharp
    public class Kata {
    }
    ```
    
  • Custom User Avatar

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