Skip to content

Commit d640e17

Browse files
RajeshGovosoheilv
andauthored
Created unit tests for jdbc.gs and advanced samples classroom.gs. (googleworkspace#331)
Co-authored-by: soheilv <[email protected]>
1 parent edf2f3f commit d640e17

File tree

2 files changed

+106
-0
lines changed

2 files changed

+106
-0
lines changed

advanced/test_classroom.gs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* Copyright Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/**
18+
* Tests listCourses function of classroom.gs
19+
*/
20+
function itShouldListCourses() {
21+
Logger.log('> itShouldListCourses');
22+
listCourses();
23+
}
24+
25+
/**
26+
* Runs all the tests
27+
*/
28+
function RUN_ALL_TESTS() {
29+
itShouldListCourses();
30+
}

service/test_jdbc.gs

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/**
2+
* Copyright Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
18+
/**
19+
* Tests createDatabase function of jdbc.gs
20+
*/
21+
function itShouldCreateDatabase() {
22+
Logger.log('itShouldCreateDatabase');
23+
createDatabase();
24+
}
25+
26+
/**
27+
* Tests createUser function of jdbc.gs
28+
*/
29+
function itShouldCreateUser() {
30+
Logger.log('itShouldCreateUser');
31+
createUser();
32+
}
33+
34+
/**
35+
* Tests createTable function of jdbc.gs
36+
*/
37+
function itShouldCreateTable() {
38+
Logger.log('itShouldCreateTable');
39+
createTable();
40+
}
41+
42+
/**
43+
* Tests writeOneRecord function of jdbc.gs
44+
*/
45+
function itShouldWriteOneRecord() {
46+
Logger.log('itShouldWriteOneRecord');
47+
writeOneRecord();
48+
}
49+
50+
/**
51+
* Tests writeManyRecords function of jdbc.gs
52+
*/
53+
function itShouldWriteManyRecords() {
54+
Logger.log('itShouldWriteManyRecords');
55+
writeManyRecords();
56+
}
57+
58+
/**
59+
* Tests readFromTable function of jdbc.gs
60+
*/
61+
function itShouldReadFromTable() {
62+
Logger.log('itShouldReadFromTable');
63+
readFromTable();
64+
}
65+
66+
/**
67+
* Runs all the tests
68+
*/
69+
function RUN_ALL_TESTS() {
70+
itShouldCreateDatabase();
71+
itShouldCreateUser();
72+
itShouldCreateTable();
73+
itShouldWriteOneRecord();
74+
itShouldWriteManyRecords();
75+
itShouldReadFromTable();
76+
}

0 commit comments

Comments
 (0)