Files
WireMock.Net/test/WireMock.Net.Tests/Plugin/PluginLoaderTests.cs
Stef Heyenrath 92923a12ae 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
2021-01-12 16:56:03 +01:00

35 lines
767 B
C#

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>();
}
}
}