Move CSharpCodeMatcher to a new project (#548)

* matcher

* wip

* fix

* <VersionPrefix>1.4.0</VersionPrefix>

* .

* x

* ?

* netstandard2.1

* {}

* test

* Fix: Assembly with same name is already loaded

* _format file

* AssemblyFile = $"WireMock.CodeHelper.Class{Guid.NewGuid()}"

* AssemblyFile = $"WireMock.CodeHelper.Class{Guid.NewGuid().ToString().Replace("-", "")}"

* GC

* x

* remove load ex

* ret

* readme

* no GC

* GetImplementationTypeByInterface

* ``

* PluginLoader

* type
This commit is contained in:
Stef Heyenrath
2021-01-12 16:56:03 +01:00
committed by GitHub
parent d4da8dc15d
commit 92923a12ae
16 changed files with 274 additions and 63 deletions

View File

@@ -0,0 +1,35 @@
using System;
using FluentAssertions;
using WireMock.Matchers;
using WireMock.Plugin;
using Xunit;
namespace WireMock.Net.Tests.Plugin
{
public class PluginLoaderTests
{
public interface IDummy
{
}
[Fact]
public void Load_Valid()
{
// Act
var result = PluginLoader.Load<ICSharpCodeMatcher>(MatchBehaviour.AcceptOnMatch, "x");
// Assert
result.Should().NotBeNull();
}
[Fact]
public void Load_Invalid_ThrowsException()
{
// Act
Action a = () => PluginLoader.Load<IDummy>();
// Assert
a.Should().Throw<DllNotFoundException>();
}
}
}