RemovePackage test: the missing-name case must not create its directory

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-16 22:59:36 +02:00
commit e57eedea71

View file

@ -637,7 +637,7 @@ public sealed class ShipModCatalogTests : IDisposable
WritePackage("mod.skiff");
File.WriteAllText(Path.Combine(_directory.Path, "outside.txt"), "x");
Directory.CreateDirectory(Path.Combine(_directory.Path, "Mods2"));
try { Directory.CreateDirectory(Path.Combine(Mods, name)); } catch (Exception) { }
if (name != "missing") try { Directory.CreateDirectory(Path.Combine(Mods, name)); } catch (Exception) { }
var before = Directory.GetDirectories(Mods).Select(Path.GetFileName).OrderBy(n => n, StringComparer.Ordinal).ToArray();
Assert.ThrowsAny<Exception>(() => ShipModCatalog.RemovePackage(Mods, name));