Renamed class still exists after rename

adam_hafneradam_hafner Posts: 91 Silver 2
edited November 6, 2024 2:38PM in SQL Test
If I create a test class called `testMyProc` and then rename the class to `testMyNewProc` works correctly.  If I now change it back to `testMyProc` it doesn't work as expected.  What I expected was that the class is renamed back to `testMyProc`, what happens is that I end up with two test classes; one named `testMyProc` that has all the tests in it, and another named `testMyNewProc` that has no tests in it.  I did a manual refresh in SQL Test and it would not go away either.  I also verified that the `testMyNewProc` doesn't actually exist in the database either.  So then I have to manually delete the class that is empty.  I am not sure what it is 'deleting' since there is no reference to that class in the database that I can see.

The issue only seems to occur if I create a class, then rename it and then rename it back to a test class name that used to exist.  So the same thing happens if I create test class named `bob`, then delete it.  Then I create a test class name `carl` and then rename it to `bob`.  Then I end up with two test classes; `bob` and `carl` when I should only have one class named `bob`.

Also, if I use the tSQLt proc named `tSQLt.RenameClass` it renames the class as expected and the SQL Test UI updates correctly, so this seems to be an issue with SQL Test and not tSQLt.

Tagged:

Best Answer

Answers

  • Hi @adam_hafner

    Many thanks for reaching out to us regarding this.

    I've been trying to reproduce what you're describing, but so far I'm not see the same behavior. Would you mind confirming what versions of SQL Test and SSMS you currently have installed?

    Also, if you are possibly able to provide any screenshots showing this behavior, that would be greatly appreciated. I'm happy to reach out to you privately via a Support ticket if you are not comfortable with providing these on this public forum.
    Kind regards

    Dan Jary | Redgate Software
    Have you visited our Help Center?
Sign In or Register to comment.