Skip to content

Commit 4790d5f

Browse files
committed
FileConventions.Test: add more tests
Add tests for DetectNotUsingKebabCaseInGitHubCIJobs function.
1 parent c776a9a commit 4790d5f

File tree

4 files changed

+92
-0
lines changed

4 files changed

+92
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
file-conventions:
7+
runs-on: ubuntu-22.04
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Print "Hello World!"
11+
run: echo "Hello World!"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
first-job:
7+
runs-on: ubuntu-22.04
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Print "Hello World!"
11+
run: echo "Hello World!"
12+
13+
second-job:
14+
runs-on: ubuntu-22.04
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Print "Hello World!"
18+
run: echo "Hello World!"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
first-job:
7+
runs-on: ubuntu-22.04
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Print "Hello World!"
11+
run: echo "Hello World!"
12+
13+
SecondJob:
14+
runs-on: ubuntu-22.04
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Print "Hello World!"
18+
run: echo "Hello World!"

src/FileConventions.Test/FileConventions.Test.fs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,3 +296,48 @@ let DetectNotUsingKebabCaseInGitHubCIJobs1() =
296296
))
297297

298298
Assert.That(DetectNotUsingKebabCaseInGitHubCIJobs fileInfo, Is.EqualTo true)
299+
300+
301+
[<Test>]
302+
let DetectNotUsingKebabCaseInGitHubCIJobs2() =
303+
let fileInfo =
304+
(FileInfo(
305+
Path.Combine(
306+
dummyFilesDirectory.FullName,
307+
"DummyCIWithKebabCaseJobName.yml"
308+
)
309+
))
310+
311+
Assert.That(
312+
DetectNotUsingKebabCaseInGitHubCIJobs fileInfo,
313+
Is.EqualTo false
314+
)
315+
316+
317+
[<Test>]
318+
let DetectNotUsingKebabCaseInGitHubCIJobs3() =
319+
let fileInfo =
320+
(FileInfo(
321+
Path.Combine(
322+
dummyFilesDirectory.FullName,
323+
"DummyCIWithMultipleJobsAndKebabCaseJobNames.yml"
324+
)
325+
))
326+
327+
Assert.That(
328+
DetectNotUsingKebabCaseInGitHubCIJobs fileInfo,
329+
Is.EqualTo false
330+
)
331+
332+
333+
[<Test>]
334+
let DetectNotUsingKebabCaseInGitHubCIJobs4() =
335+
let fileInfo =
336+
(FileInfo(
337+
Path.Combine(
338+
dummyFilesDirectory.FullName,
339+
"DummyCIWithMultipleJobsAndOnePascalCaseJobName.yml"
340+
)
341+
))
342+
343+
Assert.That(DetectNotUsingKebabCaseInGitHubCIJobs fileInfo, Is.EqualTo true)

0 commit comments

Comments
 (0)