Skip to content

Commit

Permalink
[MouseJump] fixing failing test (microsoft#27511)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeclayton committed Oct 22, 2024
1 parent 1a0d741 commit b10f475
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Globalization;
using System.Reflection;

using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MouseJump.Common.Helpers;
using MouseJump.Common.Imaging;
Expand Down Expand Up @@ -104,7 +105,15 @@ private static Bitmap LoadImageResource(string filename)
var resourceNames = assembly.GetManifestResourceNames();
if (!resourceNames.Contains(resourceName))
{
throw new InvalidOperationException($"Embedded resource '{resourceName}' does not exist.");
var message = new StringBuilder();
message.AppendLine(CultureInfo.InvariantCulture, $"Embedded resource '{resourceName}' does not exist.");
message.AppendLine($"Known resources:");
foreach (var name in resourceNames)
{
message.AppendLine(name);
}

throw new InvalidOperationException();
}

var stream = assembly.GetManifestResourceStream(resourceName)
Expand Down

0 comments on commit b10f475

Please sign in to comment.