Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niktho/e59ecfbcf7a648179d4c511524bc782e to your computer and use it in GitHub Desktop.
Save niktho/e59ecfbcf7a648179d4c511524bc782e to your computer and use it in GitHub Desktop.
CREATE PROCEDURE [testCustomer].[test Given customer is created When Customer has a middle name Then save the @MiddleName]
AS
BEGIN
--ASSEMBLE
DECLARE @FirstName NVARCHAR = 'John';
DECLARE @MiddleName NVARCHAR = 'Middle';
DECLARE @LastName NVARCHAR = 'Doe';
DECLARE @Age INT = 21;
--ACT
EXEC dbo.InsertCustomer @FirstName, @MiddleName, @LastName, @Age;
--ASSERT
DECLARE @Actual NVARCHAR = (SELECT TOP 1 MiddleName FROM dbo.Customer)
EXEC tSQLt.AssertEqualsString @MiddleName, @Actual, 'Middle name was not saved when @MiddleName was given'
END;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment