openmu/tests/MUnique.OpenMU.Pathfinding.Tests/NodeComparerTest.cs
sven-n db15dea508
Code improvements with C#10 features (#230)
The most changes are obviously by usage of the global using and file namespace features.
Additionally, because I was in a flow, I changed all private field names to start with an underscore.
2021-11-13 13:21:31 +01:00

27 lines
No EOL
850 B
C#

// <copyright file="NodeComparerTest.cs" company="MUnique">
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
// </copyright>
namespace MUnique.OpenMU.Pathfinding.Tests;
using MUnique.OpenMU.Pathfinding;
/// <summary>
/// Tests the <see cref="NodeComparer"/>.
/// </summary>
[TestFixture]
internal class NodeComparerTest
{
/// <summary>
/// Tests if <see cref="NodeComparer.Compare(Node, Node)"/> does return the
/// correct value when comparing two different nodes with different costs.
/// </summary>
[Test]
public void Compare()
{
var node1 = new Node { PredictedTotalCost = 1 };
var node2 = new Node { PredictedTotalCost = 2 };
var comparer = new NodeComparer();
Assert.That(comparer.Compare(node1, node2), Is.Negative);
}
}