diff --git a/src/FileConventions.Test/DummyFiles/DummyCIWithKebabCaseJobName.yml b/src/FileConventions.Test/DummyFiles/DummyCIWithKebabCaseJobName.yml new file mode 100644 index 000000000..ec5f065b4 --- /dev/null +++ b/src/FileConventions.Test/DummyFiles/DummyCIWithKebabCaseJobName.yml @@ -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!" diff --git a/src/FileConventions.Test/DummyFiles/DummyCIWithMultipleJobsAndKebabCaseJobNames.yml b/src/FileConventions.Test/DummyFiles/DummyCIWithMultipleJobsAndKebabCaseJobNames.yml new file mode 100644 index 000000000..0f6532c0d --- /dev/null +++ b/src/FileConventions.Test/DummyFiles/DummyCIWithMultipleJobsAndKebabCaseJobNames.yml @@ -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!" diff --git a/src/FileConventions.Test/DummyFiles/DummyCIWithMultipleJobsAndOnePascalCaseJobName.yml b/src/FileConventions.Test/DummyFiles/DummyCIWithMultipleJobsAndOnePascalCaseJobName.yml new file mode 100644 index 000000000..3eb5e7e66 --- /dev/null +++ b/src/FileConventions.Test/DummyFiles/DummyCIWithMultipleJobsAndOnePascalCaseJobName.yml @@ -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!" diff --git a/src/FileConventions.Test/FileConventions.Test.fs b/src/FileConventions.Test/FileConventions.Test.fs index 30f28e343..5e9114561 100644 --- a/src/FileConventions.Test/FileConventions.Test.fs +++ b/src/FileConventions.Test/FileConventions.Test.fs @@ -627,3 +627,48 @@ let DetectNotUsingKebabCaseInGitHubCIJobs1() = )) Assert.That(DetectNotUsingKebabCaseInGitHubCIJobs fileInfo, Is.EqualTo true) + + +[] +let DetectNotUsingKebabCaseInGitHubCIJobs2() = + let fileInfo = + (FileInfo( + Path.Combine( + dummyFilesDirectory.FullName, + "DummyCIWithKebabCaseJobName.yml" + ) + )) + + Assert.That( + DetectNotUsingKebabCaseInGitHubCIJobs fileInfo, + Is.EqualTo false + ) + + +[] +let DetectNotUsingKebabCaseInGitHubCIJobs3() = + let fileInfo = + (FileInfo( + Path.Combine( + dummyFilesDirectory.FullName, + "DummyCIWithMultipleJobsAndKebabCaseJobNames.yml" + ) + )) + + Assert.That( + DetectNotUsingKebabCaseInGitHubCIJobs fileInfo, + Is.EqualTo false + ) + + +[] +let DetectNotUsingKebabCaseInGitHubCIJobs4() = + let fileInfo = + (FileInfo( + Path.Combine( + dummyFilesDirectory.FullName, + "DummyCIWithMultipleJobsAndOnePascalCaseJobName.yml" + ) + )) + + Assert.That(DetectNotUsingKebabCaseInGitHubCIJobs fileInfo, Is.EqualTo true)