openmu/tests/MUnique.OpenMU.AttributeSystem.Tests/ConstValueAttributeTests.cs

33 lines
1.1 KiB
C#
Raw Permalink Normal View History

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>
namespace MUnique.OpenMU.AttributeSystem.Tests;
2017-11-23 07:10:40 +01:00
/// <summary>
/// Tests for the <see cref="ConstValueAttribute"/>.
/// </summary>
[TestFixture]
public class ConstValueAttributeTests
{
2017-11-23 07:10:40 +01:00
/// <summary>
/// Tests if the value of the attribute is as defined in the constructor.
2017-11-23 07:10:40 +01:00
/// </summary>
[Test]
public void ValueAsDefined()
2017-11-23 07:10:40 +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
/// <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
}
}