Skip to content

Commit d5fac5c

Browse files
Use UnreachableException
1 parent b3d524c commit d5fac5c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Cli/dotnet/commands/dotnet-test/MSBuildHandler.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using System.Collections.Concurrent;
5+
using System.Diagnostics;
56
using Microsoft.DotNet.Tools.Common;
67
using Microsoft.DotNet.Tools.Test;
78
using Microsoft.Testing.Platform.OutputDevice;
@@ -109,8 +110,8 @@ private void InitializeTestApplications(IEnumerable<TestModule> modules)
109110
{
110111
if (!module.IsTestProject && !module.IsTestingPlatformApplication)
111112
{
112-
// This should never happen. We should only ever create Module if it's a test project.
113-
throw new InvalidOperationException();
113+
// This should never happen. We should only ever create TestModule if it's a test project.
114+
throw new UnreachableException($"This program location is thought to be unreachable. Class='{nameof(MSBuildHandler)}' Method='{nameof(InitializeTestApplications)}'");
114115
}
115116

116117
var testApp = new TestApplication(module, _args);

0 commit comments

Comments
 (0)