Skip to content

Commit

Permalink
FileConventions.Test: add more tests
Browse files Browse the repository at this point in the history
Add tests for DetectNotUsingKebabCaseInGitHubCIJobs
function.
  • Loading branch information
tehraninasab committed Aug 8, 2023
1 parent 50de519 commit c1901e1
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: CI

on: [push, pull_request]

jobs:
file-conventions:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Print "Hello World!"
run: echo "Hello World!"
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CI

on: [push, pull_request]

jobs:
first-job:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Print "Hello World!"
run: echo "Hello World!"

second-job:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Print "Hello World!"
run: echo "Hello World!"
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CI

on: [push, pull_request]

jobs:
first-job:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Print "Hello World!"
run: echo "Hello World!"

SecondJob:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Print "Hello World!"
run: echo "Hello World!"
45 changes: 45 additions & 0 deletions src/FileConventions.Test/FileConventions.Test.fs
Original file line number Diff line number Diff line change
Expand Up @@ -627,3 +627,48 @@ let DetectNotUsingKebabCaseInGitHubCIJobs1() =
))

Assert.That(DetectNotUsingKebabCaseInGitHubCIJobs fileInfo, Is.EqualTo true)


[<Test>]
let DetectNotUsingKebabCaseInGitHubCIJobs2() =
let fileInfo =
(FileInfo(
Path.Combine(
dummyFilesDirectory.FullName,
"DummyCIWithKebabCaseJobName.yml"
)
))

Assert.That(
DetectNotUsingKebabCaseInGitHubCIJobs fileInfo,
Is.EqualTo false
)


[<Test>]
let DetectNotUsingKebabCaseInGitHubCIJobs3() =
let fileInfo =
(FileInfo(
Path.Combine(
dummyFilesDirectory.FullName,
"DummyCIWithMultipleJobsAndKebabCaseJobNames.yml"
)
))

Assert.That(
DetectNotUsingKebabCaseInGitHubCIJobs fileInfo,
Is.EqualTo false
)


[<Test>]
let DetectNotUsingKebabCaseInGitHubCIJobs4() =
let fileInfo =
(FileInfo(
Path.Combine(
dummyFilesDirectory.FullName,
"DummyCIWithMultipleJobsAndOnePascalCaseJobName.yml"
)
))

Assert.That(DetectNotUsingKebabCaseInGitHubCIJobs fileInfo, Is.EqualTo true)

0 comments on commit c1901e1

Please sign in to comment.