tSQLt - Database Unit Testing for SQL Server

Database Unit Testing for SQL Server

  • Home
  • Docs
    • Documents
    • Quick Start
    • Articles
  • Training
  • Downloads
tSQLt » Documents » Test Creation and Execution » RenameClass

RenameClass

Syntax

tSQLt.RenameClass [@SchemaName = ] 'class name'
                , [@NewSchemaName = ] 'new class name'

Arguments

[@SchemaName = ] ‘class name’
The name of the class (schema) to be renamed
[@NewSchemaName = ] ‘new class name’
The new name of the test class (schema)

Return Code Values

Returns 0

Error Raised

An error may be raised if an object on the test class cannot be transferred to the new test class.

Result Sets

None

Overview

tSQLt.RenameClass creates a new test class schema. All objects from the original test class schema are tranfered to the new test class schema. The original test class schema is then dropped.

Limitations

N/A

Warnings

N/A

Examples

Example: Creating and then renaming a test class

EXEC tSQLt.NewTestClass 'testFinancialApp';
GO

EXEC tSQLt.RenameClass 'testFinancialApp', 'FinancialAppTests';
GO

See Also

Creating and Running Test Cases with tSQLt

  • DropClass
  • NewTestClass
  • RenameClass
  • Run
  • RunAll
Share and Enjoy:
  • FacebookFacebook
  • TwitterTwitter
  • LinkedInLinkedIn
  • RedditReddit
  • StumbleUponStumbleUpon
  • TechnoratiTechnorati
  • PrintPrint

Navigation

  • Full user guide
  • Why you should use the tSQLt framework
  • How to get more out of tSQLt
  • Join the conversation
  • Downloads
  • Articles
  • Release Notes
  • New Logo
  • Training
  • Sponsors & Contributors
  • Why you should unit test SQL Server Code
  • Documents
    • Quick Start
    • tSQLt Tutorial
    • tSQLt Keyboard Shortcuts
    • Test Creation and Execution
      • NewTestClass
      • DropClass
      • RunAll
      • Run
      • RenameClass
    • Assertions
      • AssertNotEquals
      • AssertEmptyTable
      • AssertEquals
      • AssertEqualsString
      • AssertEqualsTable
      • AssertObjectExists
      • AssertResultSetsHaveSameMetaData
      • Fail
      • AssertObjectDoesNotExist
      • AssertEqualsTableSchema
      • AssertLike
    • Expectations
      • ExpectException
      • ExpectNoException
    • Isolating Dependencies
      • ApplyConstraint
      • FakeTable
      • SpyProcedure
      • FakeFunction
      • RemoveObjectIfExists
      • ApplyTrigger
      • RemoveObject

Links

  • tSQLt on GitHub
  • tSQLt Mailing List
  • twitter hashtag (#tsqlt)
  • tSQLt tag on stackoverflow.com
  • SQL Server Community on Slack (#tsqlt)
  • #tSQLtLive on YouTube

Sponsors

sqlity.net
redgate.com

A sqlity.net llc Web Property. | ©2010 - 2020, All Rights Reserved. | Privacy Policy | Terms of Use