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 » DropClass

DropClass

Syntax

tSQLt.DropClass [@ClassName = ] 'class name'

Arguments

[@ClassName = ] ‘class name’
The name of the class (schema) to be dropped

Return Code Values

Returns 0

Error Raised

An error may be raised if the test class already exists and an object belonging to it cannot be dropped.

Result Sets

None

Overview

tSQLt.DropClass drops a schema and all objects belonging to it. If the schema does not exist, nothing happens.

Limitations

N/A

Warnings

Care should be used when executing tSQLt.DropClass as it drops a schema and all objects on that schema.

Examples

Example: Creating a test class and the dropping it

EXEC tSQLt.NewTestClass 'testFinancialApp';
GO

EXEC tSQLt.DropClass 'testFinancialApp';
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