diff --git a/FineCodeCoverageTests/CoverageProject_Settings_Tests.cs b/FineCodeCoverageTests/CoverageProject_Settings_Tests.cs index 05eac5a9..5da78298 100644 --- a/FineCodeCoverageTests/CoverageProject_Settings_Tests.cs +++ b/FineCodeCoverageTests/CoverageProject_Settings_Tests.cs @@ -723,7 +723,7 @@ public async Task Should_Provide_The_Merged_Result_Using_Project_Settings_Async( } [Test] - public async Task Should_Add_Common_Assembly_Excludes_Includes_Async() + public async Task Should_Add_Common_Assembly_Excludes_Includes_Ignoring_Whitespace_Async() { var mockAppOptions = new Mock(); mockAppOptions.SetupAllProperties(); @@ -732,8 +732,8 @@ public async Task Should_Add_Common_Assembly_Excludes_Includes_Async() appOptions.Include = new string[] { "oldinclude" }; appOptions.ModulePathsExclude = new string[] { "msexclude" }; appOptions.ModulePathsInclude = new string[] { "msinclude" }; - appOptions.ExcludeAssemblies = new string[] { "excludeassembly" }; - appOptions.IncludeAssemblies = new string[] { "includeassembly" }; + appOptions.ExcludeAssemblies = new string[] { "excludeassembly", " "}; + appOptions.IncludeAssemblies = new string[] { "includeassembly", " "}; var autoMoqer = new AutoMoqer(); var coverageProjectSettingsManager = autoMoqer.Create(); diff --git a/SharedProject/Core/Model/CoverageProjectSettingsManager.cs b/SharedProject/Core/Model/CoverageProjectSettingsManager.cs index c5397852..cb7dff8c 100644 --- a/SharedProject/Core/Model/CoverageProjectSettingsManager.cs +++ b/SharedProject/Core/Model/CoverageProjectSettingsManager.cs @@ -58,14 +58,15 @@ private void AddCommonAssemblyExcludesIncludes(IAppOptions appOptions) } var newMs = ListFromExisting(ms); var newOldStyle = ListFromExisting(oldStyle); - - common.ToList().ForEach(assemblyFileName => + + var nonWhitespaceCommon = common.Where(c => !string.IsNullOrWhiteSpace(c)); + foreach(var assemblyFileName in nonWhitespaceCommon) { var msModulePath = $".*\\{assemblyFileName}.dll$"; newMs.Add(msModulePath); var old = $"[{assemblyFileName}]*"; newOldStyle.Add(old); - }); + } return (newOldStyle.ToArray(), newMs.ToArray()); }