Browse Source

Fix BamlDecompiler.Tests

pull/1213/head v3.2.0
Daniel Grunwald 7 years ago
parent
commit
60726e97e9
  1. 9
      ILSpy.BamlDecompiler.Tests/BamlTestRunner.cs

9
ILSpy.BamlDecompiler.Tests/BamlTestRunner.cs

@ -8,6 +8,7 @@ using System.Linq;
using System.Threading; using System.Threading;
using System.Xml.Linq; using System.Xml.Linq;
using ICSharpCode.Decompiler.Tests.Helpers; using ICSharpCode.Decompiler.Tests.Helpers;
using ICSharpCode.Decompiler.Util;
using Mono.Cecil; using Mono.Cecil;
using NUnit.Framework; using NUnit.Framework;
@ -142,14 +143,14 @@ namespace ILSpy.BamlDecompiler.Tests
if (er != null) { if (er != null) {
Stream s = er.GetResourceStream(); Stream s = er.GetResourceStream();
s.Position = 0; s.Position = 0;
ResourceReader reader; ResourcesFile resources;
try { try {
reader = new ResourceReader(s); resources = new ResourcesFile(s);
} catch (ArgumentException) { } catch (ArgumentException) {
return null; return null;
} }
foreach (DictionaryEntry entry in reader.Cast<DictionaryEntry>().OrderBy(e => e.Key.ToString())) { foreach (var entry in resources.OrderBy(e => e.Key)) {
if (entry.Key.ToString() == name) { if (entry.Key == name) {
if (entry.Value is Stream) if (entry.Value is Stream)
return (Stream)entry.Value; return (Stream)entry.Value;
if (entry.Value is byte[]) if (entry.Value is byte[])

Loading…
Cancel
Save