baseline: OpenMU upstream b5a0961 (fresh source)

This commit is contained in:
Acentech Dev
2026-07-14 19:00:35 +03:00
parent 450402e47d
commit 36fc125d5c
11968 changed files with 748705 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
// <copyright file="SelfDefensePlugInTest.cs" company="MUnique">
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
// </copyright>
namespace MUnique.OpenMU.Tests;
using Moq;
using MUnique.OpenMU.GameLogic;
using MUnique.OpenMU.GameLogic.NPC;
using MUnique.OpenMU.GameLogic.PlugIns;
using MUnique.OpenMU.DataModel.Configuration;
/// <summary>
/// Tests for <see cref="SelfDefensePlugIn"/>.
/// </summary>
[TestFixture]
public class SelfDefensePlugInTest
{
/// <summary>
/// Ensures that hitting an own summon doesn't start self-defense.
/// </summary>
[Test]
public async ValueTask OwnSummonHitDoesNotStartSelfDefenseAsync()
{
var player = await PlayerTestHelper.CreatePlayerAsync().ConfigureAwait(false);
var summonMock = new Mock<IAttackable>();
var summonable = summonMock.As<ISummonable>();
summonable.Setup(s => s.SummonedBy).Returns(player);
summonable.Setup(s => s.Definition).Returns(new MonsterDefinition());
var plugIn = new SelfDefensePlugIn();
plugIn.AttackableGotHit(summonMock.Object, player, new HitInfo(1, 0, DamageAttributes.Undefined));
Assert.That(player.GameContext.SelfDefenseState, Is.Empty);
}
}