Skip to content

Commit

Permalink
Merge pull request #481 from MUN1Z/fix/remove_deprecated_custom_plugi…
Browse files Browse the repository at this point in the history
…n_test

fix: remove deprecated custom plugin test
  • Loading branch information
sven-n authored Sep 2, 2024
2 parents bf22b2b + b040bf1 commit b7ecf11
Showing 1 changed file with 0 additions and 45 deletions.
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

0 comments on commit b7ecf11

Please sign in to comment.