The Xcode Test navigator shows a list of test case classes.
I want to delete a test case class because it\'s no longer needed.
I\'ve tried many typical approach
Using Xcode 6.2, all I had to do was to switch to the Project navigator, select the file, and press delete. I then clicked the "Remove Reference" button in the confirmation dialog that appears. After that, the tests in that file disappeared from the Test navigator immediately. Adding the file back, the tests reappeared.
I didn't have any need to delete the derived data folder, restart Xcode, etc.
Adding the file to the project again instantly restored the tests in the Test navigator.
This is certainly the desired behavior, and it sounds like it's broken in Xcode 6.3 but possibly fixed again in 6.3.1. So the real answer may just be that you need to upgrade to 6.3.1 (or downgrade to 6.2).
Before:
After:
You can add and remove tests to the project easily using the class target membership checkbox. Find the class file in the Project Navigator and select it, then in the Utilities pane, click on the File Inspector and you will see a checkbox for target membership. You can toggle it on and off in there.
If you want to delete just a single test class, you can click on the file name in the Project Navigator and press Delete and Move to Trash.
If you want to delete then entire Testing bundle, click your project name in the Project Navigator. Then select your Tests target. Click the minus (-) button at the bottom to delete it.
It is a good idea to do Unit Testing (and UI testing) in your projects. So if you want to add them back in then just click the plus (+) button.
See also