Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove deprecated custom plugin test #481

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions tests/MUnique.OpenMU.PlugIns.Tests/PlugInManagerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,51 +156,6 @@ public async ValueTask CreatedAndActiveByConfigurationAsync(bool active)
Assert.That(args.WasExecuted, Is.EqualTo(active));
}

/// <summary>
/// Tests if a custom plugin gets created and executed.
/// </summary>
[Test]
public async ValueTask CustomPlugInByConfigurationAsync()
{
var configuration = new PlugInConfiguration
{
TypeId = new Guid("4EC93343-DE05-4449-B312-04005547266C"),
IsActive = true,
CustomPlugInSource = @"
namespace test
{
using System.Runtime.InteropServices;
using MUnique.OpenMU.GameLogic;
using MUnique.OpenMU.PlugIns;
using MUnique.OpenMU.PlugIns.Tests;

[Guid(""4EC93343-DE05-4449-B312-04005547266C"")]
[PlugIn(""foo"", ""Just an example example plugin."")]
internal class ExamplePlugIn : IExamplePlugIn
{
/// <summary>
/// Gets a value indicating whether the plugin instance was executed in the test.
/// </summary>
public bool WasExecuted { get; private set; }

public void DoStuff(Player player, string text, MyEventArgs args)
{
this.WasExecuted = true;
args.Text = ""CustomPlugIn"";
}
}
}",
};
var manager = new PlugInManager(new List<PlugInConfiguration> { configuration }, new NullLoggerFactory(), this.CreateServiceProvider(), null);
var player = await TestHelper.CreatePlayerAsync().ConfigureAwait(false);
var command = "test";
var args = new MyEventArgs();

var point = manager.GetPlugInPoint<IExamplePlugIn>();
point!.DoStuff(player, command, args);
Assert.That(args.Text, Is.EqualTo("CustomPlugIn"));
}

/// <summary>
/// Tests if a custom plugin in a non-existing assembly is not created and throws no errors.
/// </summary>
Expand Down