forked from tSQLt-org/tSQLt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestThatExamplesAreDeployed.sql
More file actions
61 lines (53 loc) · 2.55 KB
/
TestThatExamplesAreDeployed.sql
File metadata and controls
61 lines (53 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
Copyright 2011 tSQLt
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
EXEC tSQLt.NewTestClass 'ExampleDeployed';
GO
CREATE PROCEDURE ExampleDeployed.[test example tests have appropriate successes and failures]
AS
BEGIN
BEGIN TRY
EXEC tSQLt.RunTestClass 'AcceleratorTests';
END TRY
BEGIN CATCH
END CATCH
SELECT TestCase, Result
INTO #Actual
FROM tSQLt.TestResult;
SELECT TOP(0) *
INTO #Expected
FROM #Actual;
INSERT INTO #Expected (TestCase, Result)
VALUES ('test ready for experimentation if 2 particles', 'Failure');
INSERT INTO #Expected (TestCase, Result)
VALUES ('test we are not ready for experimentation if there is only 1 particle', 'Success');
INSERT INTO #Expected (TestCase, Result)
VALUES ('test no particles are in a rectangle when there are no particles in the table', 'Success');
INSERT INTO #Expected (TestCase, Result)
VALUES ('test a particle within the rectangle is returned', 'Success');
INSERT INTO #Expected (TestCase, Result)
VALUES ('test a particle within the rectangle is returned with an Id, Point Location and Value', 'Success');
INSERT INTO #Expected (TestCase, Result)
VALUES ('test a particle is included only if it fits inside the boundaries of the rectangle', 'Success');
INSERT INTO #Expected (TestCase, Result)
VALUES ('test email is sent if we detected a higgs-boson', 'Success');
INSERT INTO #Expected (TestCase, Result)
VALUES ('test email is not sent if we detected something other than higgs-boson', 'Success');
INSERT INTO #Expected (TestCase, Result)
VALUES ('test status message includes the number of particles', 'Success');
INSERT INTO #Expected (TestCase, Result)
VALUES ('test foreign key is not violated if Particle color is in Color table', 'Success');
INSERT INTO #Expected (TestCase, Result)
VALUES ('test foreign key violated if Particle color is not in Color table', 'Success');
EXEC tSQLt.AssertEqualsTable '#Expected', '#Actual';
END;
GO