openmu/tests/MUnique.OpenMU.AttributeSystem.Tests/AttributeDefinitionTests.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

26 lines
No EOL
979 B
C#

// <copyright file="AttributeDefinitionTests.cs" company="MUnique">
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
// </copyright>
namespace MUnique.OpenMU.AttributeSystem.Tests;
/// <summary>
/// Tests for the <see cref="AttributeDefinition"/>.
/// </summary>
[TestFixture]
public class AttributeDefinitionTests
{
/// <summary>
/// Tests if different instances with the same id are treated as being equal.
/// </summary>
[Test]
public void Equality()
{
var attributeId = new Guid("86A31E67-8696-43C5-A9FE-CA85E1E07017");
var definition1 = new AttributeDefinition(attributeId, "foo", "bar");
var definition2 = new AttributeDefinition(attributeId, "test", "123");
Assert.That(definition1 == definition2, Is.True);
Assert.That(definition1, Is.EqualTo(definition2));
Assert.That(definition1.GetHashCode(), Is.EqualTo(definition2.GetHashCode()));
}
}