Skip to content

Commit d938770

Browse files
committed
test: drop PluginService tests that load real assemblies
AssemblyLoadContext holds a file lock on Windows, making cleanup impossible in test teardown. These tests exercise CLR assembly loading behavior rather than our plugin logic.
1 parent f53eae5 commit d938770

File tree

1 file changed

+0
-47
lines changed

1 file changed

+0
-47
lines changed

tests/SharpFM.Plugin.Tests/PluginServiceTests.cs

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -77,29 +77,6 @@ public void LoadPlugins_InvalidDll_GracefullySkips()
7777
}
7878
}
7979

80-
[Fact]
81-
public void LoadPlugins_DllWithNoPluginTypes_LoadsZero()
82-
{
83-
var dir = Path.Combine(Path.GetTempPath(), $"sharpfm-test-{Guid.NewGuid()}");
84-
Directory.CreateDirectory(dir);
85-
86-
try
87-
{
88-
// Copy a real assembly that has no IPanelPlugin implementations
89-
var nlogAssembly = typeof(NLog.LogManager).Assembly.Location;
90-
File.Copy(nlogAssembly, Path.Combine(dir, "NLog.dll"));
91-
92-
var service = CreateService(dir);
93-
service.LoadPlugins(new MockPluginHost());
94-
95-
Assert.Empty(service.LoadedPlugins);
96-
}
97-
finally
98-
{
99-
Directory.Delete(dir, recursive: true);
100-
}
101-
}
102-
10380
[Fact]
10481
public void InstallPlugin_InvalidDll_CopiesButReturnsEmpty()
10582
{
@@ -151,28 +128,4 @@ public void InstallPlugin_OverwritesExisting()
151128
}
152129
}
153130

154-
[Fact]
155-
public void LoadPlugins_WithRealPlugin_LoadsIt()
156-
{
157-
var dir = Path.Combine(Path.GetTempPath(), $"sharpfm-test-{Guid.NewGuid()}");
158-
Directory.CreateDirectory(dir);
159-
160-
try
161-
{
162-
// Copy the sample plugin and its dependencies
163-
var sampleAssembly = typeof(SharpFM.Plugin.Sample.ClipInspectorPlugin).Assembly.Location;
164-
var sampleDir = Path.GetDirectoryName(sampleAssembly)!;
165-
File.Copy(sampleAssembly, Path.Combine(dir, Path.GetFileName(sampleAssembly)));
166-
167-
var service = CreateService(dir);
168-
service.LoadPlugins(new MockPluginHost());
169-
170-
Assert.Single(service.LoadedPlugins);
171-
Assert.Equal("clip-inspector", service.LoadedPlugins[0].Id);
172-
}
173-
finally
174-
{
175-
Directory.Delete(dir, recursive: true);
176-
}
177-
}
178131
}

0 commit comments

Comments
 (0)