diff --git a/src/ServiceControl.Audit.UnitTests/PopulateAppSettingsTests.cs b/src/ServiceControl.Audit.UnitTests/PopulateAppSettingsTests.cs index 294e40cd78..23d8c6fc3b 100644 --- a/src/ServiceControl.Audit.UnitTests/PopulateAppSettingsTests.cs +++ b/src/ServiceControl.Audit.UnitTests/PopulateAppSettingsTests.cs @@ -10,6 +10,8 @@ namespace ServiceControl.UnitTests; [TestFixture] public class PopulateAppSettingsTests { + const string ConfigFileName = "ServiceControl.Audit.exe.config"; + [Test] public async Task Should_populate_appSettings_from_exe_config_file() { @@ -24,7 +26,7 @@ public async Task Should_populate_appSettings_from_exe_config_file() """; - await File.WriteAllTextAsync("ServiceControl.Audit.exe.config", config); + await File.WriteAllTextAsync(ConfigFileName, config); var fileName = "ServiceControl.Audit"; if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) @@ -70,5 +72,5 @@ public async Task Should_populate_appSettings_from_exe_config_file() } [TearDown] - public void TearDown() => File.Delete("ServiceControl.exe.config"); + public void TearDown() => File.Delete(ConfigFileName); } \ No newline at end of file diff --git a/src/ServiceControl.Monitoring.UnitTests/PopulateAppSettingsTests.cs b/src/ServiceControl.Monitoring.UnitTests/PopulateAppSettingsTests.cs index b7abd42264..a3046d7e1a 100644 --- a/src/ServiceControl.Monitoring.UnitTests/PopulateAppSettingsTests.cs +++ b/src/ServiceControl.Monitoring.UnitTests/PopulateAppSettingsTests.cs @@ -10,6 +10,8 @@ namespace ServiceControl.UnitTests; [TestFixture] public class PopulateAppSettingsTests { + const string ConfigFileName = "ServiceControl.Monitoring.exe.config"; + [Test] public async Task Should_populate_appSettings_from_exe_config_file() { @@ -24,7 +26,7 @@ public async Task Should_populate_appSettings_from_exe_config_file() """; - await File.WriteAllTextAsync("ServiceControl.Monitoring.exe.config", config); + await File.WriteAllTextAsync(ConfigFileName, config); var fileName = "ServiceControl.Monitoring"; if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) @@ -74,5 +76,5 @@ public async Task Should_populate_appSettings_from_exe_config_file() } [TearDown] - public void TearDown() => File.Delete("ServiceControl.exe.config"); + public void TearDown() => File.Delete(ConfigFileName); } \ No newline at end of file diff --git a/src/ServiceControl.UnitTests/PopulateAppSettingsTests.cs b/src/ServiceControl.UnitTests/PopulateAppSettingsTests.cs index 28b5e3e088..68907f8007 100644 --- a/src/ServiceControl.UnitTests/PopulateAppSettingsTests.cs +++ b/src/ServiceControl.UnitTests/PopulateAppSettingsTests.cs @@ -10,6 +10,8 @@ namespace ServiceControl.UnitTests; [TestFixture] public class PopulateAppSettingsTests { + const string ConfigFileName = "ServiceControl.exe.config"; + [Test] public async Task Should_populate_appSettings_from_exe_config_file() { @@ -24,7 +26,7 @@ public async Task Should_populate_appSettings_from_exe_config_file() """; - await File.WriteAllTextAsync("ServiceControl.exe.config", config); + await File.WriteAllTextAsync(ConfigFileName, config); var fileName = "ServiceControl"; if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) @@ -72,5 +74,5 @@ public async Task Should_populate_appSettings_from_exe_config_file() } [TearDown] - public void TearDown() => File.Delete("ServiceControl.exe.config"); + public void TearDown() => File.Delete(ConfigFileName); } \ No newline at end of file