Last active
August 3, 2021 06:10
-
-
Save stepbester/2877fbcff8cf154c19e48f8354d1cc73 to your computer and use it in GitHub Desktop.
SQL Unit Test for FixZoneName
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER PROCEDURE [UnitTests].[test FixZoneName] | |
AS | |
BEGIN | |
--Assemble | |
EXEC tSQLt.FakeTable @TableName = 'sth.GameZone'; | |
INSERT INTO sth.GameZone(Id, ZoneName) | |
VALUES(1, 'Green Hill'); | |
--Act | |
EXEC sth.FixZoneName @zoneId = 1; | |
--Assert | |
DECLARE @actualZoneName VARCHAR(50); | |
SELECT @actualZoneName = ZoneName | |
FROM sth.GameZone | |
WHERE Id = 1; | |
EXEC tSQLt.AssertEqualsString @Expected = 'Green Hill Zone', | |
@Actual = @actualZoneName, | |
@Message = 'Zone name was not fixed'; | |
END; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment