From 0a03ce321cc79b91cf43340eff0d3b9bd359fe2a Mon Sep 17 00:00:00 2001 From: James Gunn Date: Tue, 30 Jan 2024 10:30:03 +0000 Subject: [PATCH] Add Tests project for Access (#1118) --- .github/workflows/pr.yml | 14 +++++++++-- TeachingRecordSystem/TeachingRecordSystem.sln | 15 ++++++++++++ .../GlobalUsings.cs | 1 + ...thorizeAccessToATeachingRecordTests.csproj | 24 +++++++++++++++++++ .../UnitTest1.cs | 10 ++++++++ 5 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccessToATeachingRecordTests/GlobalUsings.cs create mode 100644 TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccessToATeachingRecordTests/TeachingRecordSystem.AuthorizeAccessToATeachingRecordTests.csproj create mode 100644 TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccessToATeachingRecordTests/UnitTest1.cs diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 95a1b7db2..5a2b8b113 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -94,7 +94,7 @@ jobs: -e ConnectionStrings__DefaultConnection="Host=localhost;Username=postgres;Password=trs;Database=trs" timeout-minutes: 5 - - name: API Tests + - name: API tests uses: ./.github/workflows/actions/test with: test_project_path: TeachingRecordSystem/tests/TeachingRecordSystem.Api.Tests @@ -104,7 +104,7 @@ jobs: -e ConnectionStrings__DefaultConnection="Host=localhost;Username=postgres;Password=trs;Database=trs" timeout-minutes: 5 - - name: Support UI Tests + - name: Support UI tests uses: ./.github/workflows/actions/test with: test_project_path: TeachingRecordSystem/tests/TeachingRecordSystem.SupportUi.Tests @@ -114,6 +114,16 @@ jobs: -e ConnectionStrings__DefaultConnection="Host=localhost;Username=postgres;Password=trs;Database=trs" timeout-minutes: 5 + - name: Authorize access to a teaching record tests + uses: ./.github/workflows/actions/test + with: + test_project_path: TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccessToATeachingRecordTests + report_name: "Authorize access to a teaching record test results" + dotnet_test_args: >- + --no-build + -e ConnectionStrings__DefaultConnection="Host=localhost;Username=postgres;Password=trs;Database=trs" + timeout-minutes: 5 + - name: Install Playwright run: pwsh ./tests/TeachingRecordSystem.SupportUi.EndToEndTests/bin/Release/net8.0/playwright.ps1 install working-directory: TeachingRecordSystem diff --git a/TeachingRecordSystem/TeachingRecordSystem.sln b/TeachingRecordSystem/TeachingRecordSystem.sln index 9ffa87d01..2e90591c1 100644 --- a/TeachingRecordSystem/TeachingRecordSystem.sln +++ b/TeachingRecordSystem/TeachingRecordSystem.sln @@ -47,6 +47,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TeachingRecordSystem.FormFl EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TeachingRecordSystem.FormFlow.Tests", "tests\TeachingRecordSystem.FormFlow.Tests\TeachingRecordSystem.FormFlow.Tests.csproj", "{8F71F933-72A9-4512-89A1-B28ACEC38BC4}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TeachingRecordSystem.AuthorizeAccessToATeachingRecordTests", "tests\TeachingRecordSystem.AuthorizeAccessToATeachingRecordTests\TeachingRecordSystem.AuthorizeAccessToATeachingRecordTests.csproj", "{08E99A19-AD1F-4F95-BF13-31248D486799}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -249,6 +251,18 @@ Global {8F71F933-72A9-4512-89A1-B28ACEC38BC4}.Release|x64.Build.0 = Release|Any CPU {8F71F933-72A9-4512-89A1-B28ACEC38BC4}.Release|x86.ActiveCfg = Release|Any CPU {8F71F933-72A9-4512-89A1-B28ACEC38BC4}.Release|x86.Build.0 = Release|Any CPU + {08E99A19-AD1F-4F95-BF13-31248D486799}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {08E99A19-AD1F-4F95-BF13-31248D486799}.Debug|Any CPU.Build.0 = Debug|Any CPU + {08E99A19-AD1F-4F95-BF13-31248D486799}.Debug|x64.ActiveCfg = Debug|Any CPU + {08E99A19-AD1F-4F95-BF13-31248D486799}.Debug|x64.Build.0 = Debug|Any CPU + {08E99A19-AD1F-4F95-BF13-31248D486799}.Debug|x86.ActiveCfg = Debug|Any CPU + {08E99A19-AD1F-4F95-BF13-31248D486799}.Debug|x86.Build.0 = Debug|Any CPU + {08E99A19-AD1F-4F95-BF13-31248D486799}.Release|Any CPU.ActiveCfg = Release|Any CPU + {08E99A19-AD1F-4F95-BF13-31248D486799}.Release|Any CPU.Build.0 = Release|Any CPU + {08E99A19-AD1F-4F95-BF13-31248D486799}.Release|x64.ActiveCfg = Release|Any CPU + {08E99A19-AD1F-4F95-BF13-31248D486799}.Release|x64.Build.0 = Release|Any CPU + {08E99A19-AD1F-4F95-BF13-31248D486799}.Release|x86.ActiveCfg = Release|Any CPU + {08E99A19-AD1F-4F95-BF13-31248D486799}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -270,6 +284,7 @@ Global {960D652A-7CB1-4EB5-9813-0CEC0BC6AB6C} = {837E2941-F1CC-41EF-A652-B605101B2E84} {3B40F089-387D-4721-A79D-1C39E682D550} = {837E2941-F1CC-41EF-A652-B605101B2E84} {8F71F933-72A9-4512-89A1-B28ACEC38BC4} = {91DCFC76-6636-4AC1-B81C-7F8AE1F22116} + {08E99A19-AD1F-4F95-BF13-31248D486799} = {91DCFC76-6636-4AC1-B81C-7F8AE1F22116} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {61D239F9-888B-4D01-84BC-9276C92383EA} diff --git a/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccessToATeachingRecordTests/GlobalUsings.cs b/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccessToATeachingRecordTests/GlobalUsings.cs new file mode 100644 index 000000000..c802f4480 --- /dev/null +++ b/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccessToATeachingRecordTests/GlobalUsings.cs @@ -0,0 +1 @@ +global using Xunit; diff --git a/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccessToATeachingRecordTests/TeachingRecordSystem.AuthorizeAccessToATeachingRecordTests.csproj b/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccessToATeachingRecordTests/TeachingRecordSystem.AuthorizeAccessToATeachingRecordTests.csproj new file mode 100644 index 000000000..f8d4d4333 --- /dev/null +++ b/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccessToATeachingRecordTests/TeachingRecordSystem.AuthorizeAccessToATeachingRecordTests.csproj @@ -0,0 +1,24 @@ + + + + net8.0 + + false + true + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + diff --git a/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccessToATeachingRecordTests/UnitTest1.cs b/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccessToATeachingRecordTests/UnitTest1.cs new file mode 100644 index 000000000..bf38c50ed --- /dev/null +++ b/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccessToATeachingRecordTests/UnitTest1.cs @@ -0,0 +1,10 @@ +namespace TeachingRecordSystem.AuthorizeAccessToATeachingRecordTests; + +public class UnitTest1 +{ + [Fact] + public void Test1() + { + + } +}