Update dependencies, replace Moq with NSubstitute

This commit is contained in:
Deukhoofd 2025-05-03 13:23:25 +02:00
parent b69ba6eaff
commit 0d869a0cc6
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
11 changed files with 174 additions and 156 deletions

View File

@ -17,16 +17,16 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentResults" Version="3.16.0" />
<PackageReference Include="JetBrains.Annotations" Version="2024.2.0" />
<PackageReference Include="PolySharp" Version="1.14.1">
<PackageReference Include="FluentResults" Version="3.16.0"/>
<PackageReference Include="JetBrains.Annotations" Version="2024.3.0"/>
<PackageReference Include="PolySharp" Version="1.15.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Collections.Immutable" Version="8.0.0" />
<PackageReference Include="System.Collections.Immutable" Version="8.0.0"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PkmnLib.Static\PkmnLib.Static.csproj" />
<ProjectReference Include="..\PkmnLib.Static\PkmnLib.Static.csproj"/>
</ItemGroup>
</Project>

View File

@ -17,12 +17,12 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="PcgRandom" Version="1.2.0" />
<PackageReference Include="PolySharp" Version="1.14.1">
<PackageReference Include="PcgRandom" Version="1.2.0"/>
<PackageReference Include="PolySharp" Version="1.15.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Collections.Immutable" Version="8.0.0" />
<PackageReference Include="System.Collections.Immutable" Version="8.0.0"/>
</ItemGroup>
</Project>

View File

@ -1,4 +1,3 @@
using Moq;
using PkmnLib.Dynamic.Models;
using PkmnLib.Dynamic.Models.Choices;
@ -9,99 +8,99 @@ public class ChoiceQueueTests
[Test]
public async Task ChoiceQueue_MovePokemonChoiceNext()
{
var pokemon1 = new Mock<IPokemon>();
var pokemon2 = new Mock<IPokemon>();
var pokemon3 = new Mock<IPokemon>();
var pokemon4 = new Mock<IPokemon>();
var pokemon1 = Substitute.For<IPokemon>();
var pokemon2 = Substitute.For<IPokemon>();
var pokemon3 = Substitute.For<IPokemon>();
var pokemon4 = Substitute.For<IPokemon>();
var choice1 = new Mock<ITurnChoice>();
choice1.Setup(c => c.User).Returns(pokemon1.Object);
var choice2 = new Mock<ITurnChoice>();
choice2.Setup(c => c.User).Returns(pokemon2.Object);
var choice3 = new Mock<ITurnChoice>();
choice3.Setup(c => c.User).Returns(pokemon3.Object);
var choice4 = new Mock<ITurnChoice>();
choice4.Setup(c => c.User).Returns(pokemon4.Object);
var choice1 = Substitute.For<ITurnChoice>();
choice1.User.Returns(pokemon1);
var choice2 = Substitute.For<ITurnChoice>();
choice2.User.Returns(pokemon2);
var choice3 = Substitute.For<ITurnChoice>();
choice3.User.Returns(pokemon3);
var choice4 = Substitute.For<ITurnChoice>();
choice4.User.Returns(pokemon4);
var queue = new BattleChoiceQueue([choice1.Object, choice2.Object, choice3.Object, choice4.Object]);
var result = queue.MovePokemonChoiceNext(pokemon3.Object);
var queue = new BattleChoiceQueue([choice1, choice2, choice3, choice4]);
var result = queue.MovePokemonChoiceNext(pokemon3);
await Assert.That(result).IsTrue();
await Assert.That(queue.Dequeue()).IsEqualTo(choice3.Object);
await Assert.That(queue.Dequeue()).IsEqualTo(choice3);
}
[Test]
public async Task ChoiceQueue_MovePokemonChoiceNextFailsIfAlreadyExecuted()
{
var pokemon1 = new Mock<IPokemon>();
var pokemon2 = new Mock<IPokemon>();
var pokemon3 = new Mock<IPokemon>();
var pokemon4 = new Mock<IPokemon>();
var pokemon1 = Substitute.For<IPokemon>();
var pokemon2 = Substitute.For<IPokemon>();
var pokemon3 = Substitute.For<IPokemon>();
var pokemon4 = Substitute.For<IPokemon>();
var choice1 = new Mock<ITurnChoice>();
choice1.Setup(c => c.User).Returns(pokemon1.Object);
var choice2 = new Mock<ITurnChoice>();
choice2.Setup(c => c.User).Returns(pokemon2.Object);
var choice3 = new Mock<ITurnChoice>();
choice3.Setup(c => c.User).Returns(pokemon3.Object);
var choice4 = new Mock<ITurnChoice>();
choice4.Setup(c => c.User).Returns(pokemon4.Object);
var choice1 = Substitute.For<ITurnChoice>();
choice1.User.Returns(pokemon1);
var choice2 = Substitute.For<ITurnChoice>();
choice2.User.Returns(pokemon2);
var choice3 = Substitute.For<ITurnChoice>();
choice3.User.Returns(pokemon3);
var choice4 = Substitute.For<ITurnChoice>();
choice4.User.Returns(pokemon4);
var queue = new BattleChoiceQueue([choice1.Object, choice2.Object, choice3.Object, choice4.Object]);
var queue = new BattleChoiceQueue([choice1, choice2, choice3, choice4]);
queue.Dequeue();
var result = queue.MovePokemonChoiceNext(pokemon1.Object);
var result = queue.MovePokemonChoiceNext(pokemon1);
await Assert.That(result).IsFalse();
await Assert.That(queue.Dequeue()).IsEqualTo(choice2.Object);
await Assert.That(queue.Dequeue()).IsEqualTo(choice2);
}
[Test]
public async Task ChoiceQueue_MovePokemonChoiceLast()
{
var pokemon1 = new Mock<IPokemon>();
var pokemon2 = new Mock<IPokemon>();
var pokemon3 = new Mock<IPokemon>();
var pokemon4 = new Mock<IPokemon>();
var pokemon1 = Substitute.For<IPokemon>();
var pokemon2 = Substitute.For<IPokemon>();
var pokemon3 = Substitute.For<IPokemon>();
var pokemon4 = Substitute.For<IPokemon>();
var choice1 = new Mock<ITurnChoice>();
choice1.Setup(c => c.User).Returns(pokemon1.Object);
var choice2 = new Mock<ITurnChoice>();
choice2.Setup(c => c.User).Returns(pokemon2.Object);
var choice3 = new Mock<ITurnChoice>();
choice3.Setup(c => c.User).Returns(pokemon3.Object);
var choice4 = new Mock<ITurnChoice>();
choice4.Setup(c => c.User).Returns(pokemon4.Object);
var choice1 = Substitute.For<ITurnChoice>();
choice1.User.Returns(pokemon1);
var choice2 = Substitute.For<ITurnChoice>();
choice2.User.Returns(pokemon2);
var choice3 = Substitute.For<ITurnChoice>();
choice3.User.Returns(pokemon3);
var choice4 = Substitute.For<ITurnChoice>();
choice4.User.Returns(pokemon4);
var queue = new BattleChoiceQueue([choice1.Object, choice2.Object, choice3.Object, choice4.Object]);
var result = queue.MovePokemonChoiceLast(pokemon2.Object);
var queue = new BattleChoiceQueue([choice1, choice2, choice3, choice4]);
var result = queue.MovePokemonChoiceLast(pokemon2);
await Assert.That(result).IsTrue();
await Assert.That(queue.Dequeue()).IsEqualTo(choice1.Object);
await Assert.That(queue.Dequeue()).IsEqualTo(choice3.Object);
await Assert.That(queue.Dequeue()).IsEqualTo(choice4.Object);
await Assert.That(queue.Dequeue()).IsEqualTo(choice2.Object);
await Assert.That(queue.Dequeue()).IsEqualTo(choice1);
await Assert.That(queue.Dequeue()).IsEqualTo(choice3);
await Assert.That(queue.Dequeue()).IsEqualTo(choice4);
await Assert.That(queue.Dequeue()).IsEqualTo(choice2);
}
[Test]
public async Task ChoiceQueue_MovePokemonChoiceLastFailsIfAlreadyExecuted()
{
var pokemon1 = new Mock<IPokemon>();
var pokemon2 = new Mock<IPokemon>();
var pokemon3 = new Mock<IPokemon>();
var pokemon4 = new Mock<IPokemon>();
var pokemon1 = Substitute.For<IPokemon>();
var pokemon2 = Substitute.For<IPokemon>();
var pokemon3 = Substitute.For<IPokemon>();
var pokemon4 = Substitute.For<IPokemon>();
var choice1 = new Mock<ITurnChoice>();
choice1.Setup(c => c.User).Returns(pokemon1.Object);
var choice2 = new Mock<ITurnChoice>();
choice2.Setup(c => c.User).Returns(pokemon2.Object);
var choice3 = new Mock<ITurnChoice>();
choice3.Setup(c => c.User).Returns(pokemon3.Object);
var choice4 = new Mock<ITurnChoice>();
choice4.Setup(c => c.User).Returns(pokemon4.Object);
var choice1 = Substitute.For<ITurnChoice>();
choice1.User.Returns(pokemon1);
var choice2 = Substitute.For<ITurnChoice>();
choice2.User.Returns(pokemon2);
var choice3 = Substitute.For<ITurnChoice>();
choice3.User.Returns(pokemon3);
var choice4 = Substitute.For<ITurnChoice>();
choice4.User.Returns(pokemon4);
var queue = new BattleChoiceQueue([choice1.Object, choice2.Object, choice3.Object, choice4.Object]);
var queue = new BattleChoiceQueue([choice1, choice2, choice3, choice4]);
queue.Dequeue();
var result = queue.MovePokemonChoiceLast(pokemon1.Object);
var result = queue.MovePokemonChoiceLast(pokemon1);
await Assert.That(result).IsFalse();
await Assert.That(queue.Dequeue()).IsEqualTo(choice2.Object);
await Assert.That(queue.Dequeue()).IsEqualTo(choice3.Object);
await Assert.That(queue.Dequeue()).IsEqualTo(choice4.Object);
await Assert.That(queue.Dequeue()).IsEqualTo(choice2);
await Assert.That(queue.Dequeue()).IsEqualTo(choice3);
await Assert.That(queue.Dequeue()).IsEqualTo(choice4);
}
}

View File

@ -1,3 +1,4 @@
global using TUnit;
global using NSubstitute;
global using FluentAssertions;
global using LevelInt = byte;

View File

@ -10,12 +10,19 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Moq" Version="4.20.70"/>
<PackageReference Include="CSPath" Version="0.0.4"/>
<PackageReference Include="FluentAssertions" Version="6.12.0"/>
<PackageReference Include="coverlet.collector" Version="6.0.0"/>
<PackageReference Include="FluentAssertions" Version="8.2.0"/>
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NSubstitute" Version="5.3.0"/>
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.17">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Linq.Async" Version="6.0.1"/>
<PackageReference Include="TUnit" Version="0.5.18"/>
<PackageReference Include="TUnit" Version="0.19.116"/>
</ItemGroup>
<ItemGroup>

View File

@ -23,37 +23,37 @@ public class DamageCalculatorTests
[Test]
public async Task BulbapediaExampleDamageTest()
{
var attacker = new Mock<IPokemon>();
var attacker = Substitute.For<IPokemon>();
// Imagine a level 75 Glaceon
attacker.Setup(x => x.Level).Returns(75);
attacker.Level.Returns((byte)75);
// with an effective Attack stat of 123
attacker.Setup(x => x.BoostedStats).Returns(new StatisticSet<uint>(1, 123, 1, 1, 1, 1));
attacker.BoostedStats.Returns(new StatisticSet<uint>(1, 123, 1, 1, 1, 1));
// We use 10 as the Ice type
attacker.Setup(x => x.Types).Returns([new TypeIdentifier(10, "ice")]);
attacker.Types.Returns([new TypeIdentifier(10, "ice")]);
var defender = new Mock<IPokemon>();
var defender = Substitute.For<IPokemon>();
// a Garchomp with an effective Defense stat of 163
defender.Setup(x => x.BoostedStats).Returns(new StatisticSet<uint>(1, 1, 163, 1, 1, 1));
defender.Setup(x => x.GetScripts()).Returns(new ScriptIterator([]));
defender.BoostedStats.Returns(new StatisticSet<uint>(1, 1, 163, 1, 1, 1));
defender.GetScripts().Returns(new ScriptIterator([]));
var useMove = new Mock<IMoveData>();
var useMove = Substitute.For<IMoveData>();
// Ice Fang (an Ice-type physical move with a power of 65)
useMove.Setup(x => x.Category).Returns(MoveCategory.Physical);
useMove.Category.Returns(MoveCategory.Physical);
var damageCalculator = new Gen7DamageCalculator(false);
var executingMove = new Mock<IExecutingMove>();
executingMove.Setup(x => x.UseMove).Returns(useMove.Object);
executingMove.Setup(x => x.User).Returns(attacker.Object);
executingMove.Setup(x => x.GetScripts()).Returns(new ScriptIterator([]));
var executingMove = Substitute.For<IExecutingMove>();
executingMove.UseMove.Returns(useMove);
executingMove.User.Returns(attacker);
executingMove.GetScripts().Returns(new ScriptIterator([]));
var hit = new Mock<IHitData>();
var hit = Substitute.For<IHitData>();
// Ice Fang (an Ice-type physical move with a power of 65)
hit.Setup(x => x.BasePower).Returns(65);
hit.Setup(x => x.Type).Returns(new TypeIdentifier(10, "ice"));
hit.BasePower.Returns((byte)65);
hit.Type.Returns(new TypeIdentifier(10, "ice"));
// has a double weakness to the move's Ice type
hit.Setup(x => x.Effectiveness).Returns(4.0f);
hit.Effectiveness.Returns(4.0f);
var damage = damageCalculator.GetDamage(executingMove.Object, defender.Object, 0, hit.Object);
var damage = damageCalculator.GetDamage(executingMove, defender, 0, hit);
// That means Ice Fang will do between 168 and 196 HP damage, depending on luck.
// Note that we are testing deterministic damage, so we expect the maximum damage.
await Assert.That(damage).IsEqualTo((uint)196);

View File

@ -1,2 +1,2 @@
global using TUnit;
global using Moq;
global using NSubstitute;

View File

@ -10,8 +10,15 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Moq" Version="4.20.70"/>
<PackageReference Include="coverlet.collector" Version="6.0.0"/>
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NSubstitute" Version="5.3.0"/>
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.17">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="TUnit" Version="0.5.18"/>
</ItemGroup>

View File

@ -10,15 +10,16 @@ public class AcrobaticsTests
public async Task ChangeBasePower_UserNotHoldingItem_BasePowerDoubles()
{
// Arrange
var move = new Mock<IExecutingMove>();
var target = new Mock<IPokemon>();
var move = Substitute.For<IExecutingMove>();
var target = Substitute.For<IPokemon>();
byte basePower = 10;
move.Setup(m => m.User).Returns(new Mock<IPokemon>().Object);
move.Setup(m => m.User.HeldItem).Returns((IItem?)null);
var user = Substitute.For<IPokemon>();
user.HeldItem.Returns((IItem?)null);
move.User.Returns(user);
var acrobatics = new Acrobatics();
// Act
acrobatics.ChangeBasePower(move.Object, target.Object, 0, ref basePower);
acrobatics.ChangeBasePower(move, target, 0, ref basePower);
// Assert
await Assert.That(basePower).IsEqualTo((byte)20);
@ -28,15 +29,16 @@ public class AcrobaticsTests
public async Task ChangeBasePower_UserHoldingItem_BasePowerUnchanged()
{
// Arrange
var move = new Mock<IExecutingMove>();
var target = new Mock<IPokemon>();
var move = Substitute.For<IExecutingMove>();
var target = Substitute.For<IPokemon>();
byte basePower = 10;
move.Setup(m => m.User).Returns(new Mock<IPokemon>().Object);
move.Setup(m => m.User.HeldItem).Returns(new Mock<IItem>().Object);
var user = Substitute.For<IPokemon>();
user.HeldItem.Returns(Substitute.For<IItem>());
move.User.Returns(user);
var acrobatics = new Acrobatics();
// Act
acrobatics.ChangeBasePower(move.Object, target.Object, 0, ref basePower);
acrobatics.ChangeBasePower(move, target, 0, ref basePower);
// Assert
await Assert.That(basePower).IsEqualTo((byte)10);
@ -46,15 +48,16 @@ public class AcrobaticsTests
public async Task ChangeBasePower_UserNotHoldingItem_NoOverflow()
{
// Arrange
var move = new Mock<IExecutingMove>();
var target = new Mock<IPokemon>();
var move = Substitute.For<IExecutingMove>();
var target = Substitute.For<IPokemon>();
byte basePower = 200;
move.Setup(m => m.User).Returns(new Mock<IPokemon>().Object);
move.Setup(m => m.User.HeldItem).Returns((IItem?)null);
var user = Substitute.For<IPokemon>();
move.User.Returns(user);
user.HeldItem.Returns((IItem?)null);
var acrobatics = new Acrobatics();
// Act
acrobatics.ChangeBasePower(move.Object, target.Object, 0, ref basePower);
acrobatics.ChangeBasePower(move, target, 0, ref basePower);
// Assert
await Assert.That(basePower).IsEqualTo(byte.MaxValue);

View File

@ -47,22 +47,22 @@ public class HiddenPowerTests
typeLibrary.RegisterType("dark");
typeLibrary.RegisterType("fairy");
var executingMove = new Mock<IExecutingMove>(MockBehavior.Strict);
var user = new Mock<IPokemon>(MockBehavior.Strict);
var target = new Mock<IPokemon>(MockBehavior.Strict);
var dynamicLibrary = new Mock<IDynamicLibrary>(MockBehavior.Strict);
var staticLibrary = new Mock<IStaticLibrary>(MockBehavior.Strict);
var executingMove = Substitute.For<IExecutingMove>();
var user = Substitute.For<IPokemon>();
var target = Substitute.For<IPokemon>();
var dynamicLibrary = Substitute.For<IDynamicLibrary>();
var staticLibrary = Substitute.For<IStaticLibrary>();
executingMove.SetupGet(x => x.User).Returns(user.Object);
user.SetupGet(x => x.IndividualValues).Returns(test.Ivs);
user.SetupGet(x => x.Library).Returns(dynamicLibrary.Object);
staticLibrary.Setup(x => x.Types).Returns(typeLibrary);
dynamicLibrary.Setup(x => x.StaticLibrary).Returns(staticLibrary.Object);
executingMove.User.Returns(user);
user.IndividualValues.Returns(test.Ivs);
user.Library.Returns(dynamicLibrary);
staticLibrary.Types.Returns(typeLibrary);
dynamicLibrary.StaticLibrary.Returns(staticLibrary);
TypeIdentifier? moveType = new TypeIdentifier(1, "normal");
var hiddenPower = new HiddenPower();
hiddenPower.ChangeMoveType(executingMove.Object, target.Object, 0, ref moveType);
hiddenPower.ChangeMoveType(executingMove, target, 0, ref moveType);
await Assert.That(moveType!.Value.Name).IsEqualTo(test.ExpectedType);
}
@ -70,20 +70,20 @@ public class HiddenPowerTests
[Test, MethodDataSource(nameof(HiddenPowerTestData))]
public async Task HiddenPower_ChangesBasePower(TestCaseData test)
{
var executingMove = new Mock<IExecutingMove>(MockBehavior.Strict);
var user = new Mock<IPokemon>(MockBehavior.Strict);
var target = new Mock<IPokemon>(MockBehavior.Strict);
var dynamicLibrary = new Mock<IDynamicLibrary>(MockBehavior.Strict);
var staticLibrary = new Mock<IStaticLibrary>(MockBehavior.Strict);
var executingMove = Substitute.For<IExecutingMove>();
var user = Substitute.For<IPokemon>();
var target = Substitute.For<IPokemon>();
var dynamicLibrary = Substitute.For<IDynamicLibrary>();
var staticLibrary = Substitute.For<IStaticLibrary>();
executingMove.SetupGet(x => x.User).Returns(user.Object);
user.SetupGet(x => x.IndividualValues).Returns(test.Ivs);
user.SetupGet(x => x.Library).Returns(dynamicLibrary.Object);
dynamicLibrary.Setup(x => x.StaticLibrary).Returns(staticLibrary.Object);
executingMove.User.Returns(user);
user.IndividualValues.Returns(test.Ivs);
user.Library.Returns(dynamicLibrary);
dynamicLibrary.StaticLibrary.Returns(staticLibrary);
var hiddenPower = new HiddenPower();
byte power = 0;
hiddenPower.ChangeBasePower(executingMove.Object, target.Object, 0, ref power);
hiddenPower.ChangeBasePower(executingMove, target, 0, ref power);
await Assert.That(power).IsEqualTo(test.ExpectedPower);
}

View File

@ -3,6 +3,7 @@ using PkmnLib.Dynamic.Models;
using PkmnLib.Plugin.Gen7.Scripts.Moves;
using PkmnLib.Static;
using PkmnLib.Static.Libraries;
using PkmnLib.Static.Utils;
namespace PkmnLib.Plugin.Gen7.Tests.Scripts.Moves;
@ -60,28 +61,28 @@ public class MultiAttackTests
typeLibrary.RegisterType("fairy");
// Arrange
var move = new Mock<IExecutingMove>();
var target = new Mock<IPokemon>();
var user = new Mock<IPokemon>();
var move = Substitute.For<IExecutingMove>();
var target = Substitute.For<IPokemon>();
var user = Substitute.For<IPokemon>();
TypeIdentifier? typeIdentifier = new TypeIdentifier(1, "Normal");
var dynamicLibrary = new Mock<IDynamicLibrary>();
var staticLibrary = new Mock<IStaticLibrary>();
var item = new Mock<IItem>();
var dynamicLibrary = Substitute.For<IDynamicLibrary>();
var staticLibrary = Substitute.For<IStaticLibrary>();
var item = Substitute.For<IItem>();
user.Setup(u => u.Library).Returns(dynamicLibrary.Object);
dynamicLibrary.Setup(d => d.StaticLibrary).Returns(staticLibrary.Object);
staticLibrary.Setup(s => s.Types).Returns(typeLibrary);
item.Setup(i => i.Name).Returns(test.ItemName!);
move.Setup(m => m.User).Returns(user.Object);
user.Library.Returns(dynamicLibrary);
dynamicLibrary.StaticLibrary.Returns(staticLibrary);
staticLibrary.Types.Returns(typeLibrary);
item.Name.Returns((StringKey)test.ItemName!);
move.User.Returns(user);
if (test.ItemName != null)
move.Setup(m => m.User.HeldItem).Returns(item.Object);
user.HeldItem.Returns(item);
else
move.Setup(m => m.User.HeldItem).Returns((IItem?)null);
user.HeldItem.Returns((IItem?)null);
var multiAttack = new MultiAttack();
// Act
multiAttack.ChangeMoveType(move.Object, target.Object, 0, ref typeIdentifier);
multiAttack.ChangeMoveType(move, target, 0, ref typeIdentifier);
// Assert
await Assert.That(typeIdentifier!.Value.Name).IsEqualTo(test.ExpectedTypeName);