2017-11-23 07:10:40 +01:00
|
|
|
// <copyright file="ConstValueAttributeTests.cs" company="MUnique">
|
|
|
|
|
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
|
|
|
|
|
// </copyright>
|
|
|
|
|
|
2021-11-13 13:21:31 +01:00
|
|
|
namespace MUnique.OpenMU.AttributeSystem.Tests;
|
2017-11-23 07:10:40 +01:00
|
|
|
|
2021-11-13 13:21:31 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Tests for the <see cref="ConstValueAttribute"/>.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class ConstValueAttributeTests
|
|
|
|
|
{
|
2017-11-23 07:10:40 +01:00
|
|
|
/// <summary>
|
2021-11-13 13:21:31 +01:00
|
|
|
/// Tests if the value of the attribute is as defined in the constructor.
|
2017-11-23 07:10:40 +01:00
|
|
|
/// </summary>
|
2021-11-13 13:21:31 +01:00
|
|
|
[Test]
|
|
|
|
|
public void ValueAsDefined()
|
2017-11-23 07:10:40 +01:00
|
|
|
{
|
2021-11-13 13:21:31 +01:00
|
|
|
const int constantValue = 999;
|
|
|
|
|
var element = new ConstValueAttribute(constantValue, new AttributeDefinition());
|
|
|
|
|
Assert.That(element.Value, Is.EqualTo(constantValue));
|
|
|
|
|
}
|
2017-11-23 07:10:40 +01:00
|
|
|
|
2021-11-13 13:21:31 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Tests if the <see cref="ConstValueAttribute.AggregateType"/> is <see cref="AggregateType.AddRaw"/>.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Test]
|
|
|
|
|
public void AggregateTypeIsRaw()
|
|
|
|
|
{
|
|
|
|
|
var element = new ConstValueAttribute(999, new AttributeDefinition());
|
|
|
|
|
Assert.That(element.AggregateType, Is.EqualTo(AggregateType.AddRaw));
|
2017-11-23 07:10:40 +01:00
|
|
|
}
|
|
|
|
|
}
|