From 8335cfc61d069d9f113ef5d33bfd0f33eea8d196 Mon Sep 17 00:00:00 2001 From: iatsuta <98311820+iatsuta@users.noreply.github.com> Date: Fri, 6 Sep 2024 16:36:40 +0200 Subject: [PATCH] add-LocalAdmins-automation (#460) --- .../Settings/AutomationFrameworkSettings.cs | 4 ++- src/IAD.Framework.sln | 6 ---- src/_SampleSystem/_Configs/AppSettings.json | 29 ------------------- .../__Support/TestData/TestDataInitializer.cs | 7 +++++ 4 files changed, 10 insertions(+), 36 deletions(-) delete mode 100644 src/_SampleSystem/_Configs/AppSettings.json diff --git a/src/Framework.AutomationCore/Settings/AutomationFrameworkSettings.cs b/src/Framework.AutomationCore/Settings/AutomationFrameworkSettings.cs index c9a2a48f1..49e8fef64 100644 --- a/src/Framework.AutomationCore/Settings/AutomationFrameworkSettings.cs +++ b/src/Framework.AutomationCore/Settings/AutomationFrameworkSettings.cs @@ -22,5 +22,7 @@ public class AutomationFrameworkSettings public string ConnectionStringName { get; set; } = "DefaultConnection"; - public string[] SecondaryDatabases { get; set; } = Array.Empty(); + public string[] SecondaryDatabases { get; set; } = []; + + public string[] LocalAdmins { get; set; } = []; } diff --git a/src/IAD.Framework.sln b/src/IAD.Framework.sln index 553348b80..e2b98bcc5 100644 --- a/src/IAD.Framework.sln +++ b/src/IAD.Framework.sln @@ -164,11 +164,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GeneratedLayout", "Generate EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleSystem.Generated.DTO", "_SampleSystem\SampleSystem.Generated.DTO\SampleSystem.Generated.DTO.csproj", "{2772FD7D-41AB-4251-81CE-D740259441A3}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Configs", "_Configs", "{621D8E83-5142-4213-96E3-769F400896E3}" - ProjectSection(SolutionItems) = preProject - _SampleSystem\_Configs\appsettings.json = _SampleSystem\_Configs\appsettings.json - EndProjectSection -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Framework.DomainDriven.DBGenerator.Tests.Unit", "_DomainDriven\Framework.DomainDriven.DBGenerator.Tests.Unit\Framework.DomainDriven.DBGenerator.Tests.Unit.csproj", "{98FEEA7E-E790-4193-B12A-66513EFFCCCF}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Framework.Validation.Tests.Unit", "Framework.Validation.Tests.Unit\Framework.Validation.Tests.Unit.csproj", "{47648BAE-016C-42A5-BBE1-C5426EAF50EC}" @@ -3630,7 +3625,6 @@ Global {2EE5B710-74FD-49CC-8865-0D560A298D69} = {37EA9A97-A597-4549-BC2B-0EB219181532} {37EA9A97-A597-4549-BC2B-0EB219181532} = {AC6F29CD-7AEC-42EC-BB72-312230C681F3} {2772FD7D-41AB-4251-81CE-D740259441A3} = {37EA9A97-A597-4549-BC2B-0EB219181532} - {621D8E83-5142-4213-96E3-769F400896E3} = {AC6F29CD-7AEC-42EC-BB72-312230C681F3} {98FEEA7E-E790-4193-B12A-66513EFFCCCF} = {556BB35C-545E-4EC7-9245-016FF2248A58} {B204BB7F-D20D-405C-B051-BC86C9B65582} = {647A0A18-C3F2-4E58-B52F-6310B1F8B963} {857C63C0-38C6-4EFB-8E6A-F9D1B645362A} = {BD23CE26-E161-47F1-826E-BD37F4F51C9E} diff --git a/src/_SampleSystem/_Configs/AppSettings.json b/src/_SampleSystem/_Configs/AppSettings.json deleted file mode 100644 index bb660b80d..000000000 --- a/src/_SampleSystem/_Configs/AppSettings.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "TestRunMode": "DefaultRunModeOnEmptyDatabase", - "TestRunServerRootFolder": "SampleSystem\\ServerRoot", - "TestRunTempFolder": "SampleSystem\\Temp", - "UseLocalDb": true, - "SystemName": "SampleSystem", - "ConnectionStrings": "Data Source=sqlexpress;Initial Catalog=SampleSystem;Integrated Security=True;Application Name=SampleSystem;TrustServerCertificate=True", - "Hangfire": { - "ConnectionString": "Data Source=sqlexpress;Initial Catalog=Jobs;Integrated Security=True;", - "Jobs": { - "TaskReview": { - "Hour": 1, - "Minutes": 0, - "Period": 1 - } - } - }, - - "MsmqServer": "biztalk", - "NotificationsEnable": true, - "notificationFromAddress": "LuxSampleSystemSupport@luxoft.com", - "notificationFromAddressDisplayName": "LUX SampleSystem Support", - "ExceptionNotificationEmails": "egorov@luxoft.com", - "IntegrationEventQueueName": "SampleSystemEventQueue", - "NotificationsQueueName": "NotificationEventQueue", - "RegularJobQueueName": "REGULARJOBQUEUE", - "useMessageSenderForSalaryBonusChangeRequest": true, - "NotificationsFromEmailAddress": "LuxSampleSystemSupport@luxoft.com" -} diff --git a/src/_SampleSystem/_Tests/SampleSystem.IntegrationTests/__Support/TestData/TestDataInitializer.cs b/src/_SampleSystem/_Tests/SampleSystem.IntegrationTests/__Support/TestData/TestDataInitializer.cs index 78e57fe6d..195f29137 100644 --- a/src/_SampleSystem/_Tests/SampleSystem.IntegrationTests/__Support/TestData/TestDataInitializer.cs +++ b/src/_SampleSystem/_Tests/SampleSystem.IntegrationTests/__Support/TestData/TestDataInitializer.cs @@ -41,6 +41,13 @@ public async Task InitializeAsyncInternal(CancellationToken cancellationToken) login: integrationTestUserName); authHelper.AddUserToAdmin(integrationTestUserName); + + foreach (var localAdmin in settings.Value.LocalAdmins) + { + dataHelper.SaveEmployee(login: localAdmin); + + authHelper.AddUserToAdmin(localAdmin); + } } private void FillMainData()