mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-15 23:02:34 +02:00
Robust.UnitTesting was both ALL tests for RT, and also API surface for content tests. Tests are now split into separate projects as appropriate, and the API side has also been split off.
28 lines
647 B
C#
28 lines
647 B
C#
using NUnit.Framework;
|
|
using Robust.Shared.Serialization.Manager.Attributes;
|
|
using Robust.Shared.Serialization.Markdown.Mapping;
|
|
|
|
namespace Robust.UnitTesting.Shared.Serialization;
|
|
|
|
internal sealed partial class DataStructTest : OurSerializationTest
|
|
{
|
|
[DataDefinition]
|
|
public partial struct DefaultIntDataStruct
|
|
{
|
|
public int A = 5;
|
|
|
|
public DefaultIntDataStruct()
|
|
{
|
|
}
|
|
}
|
|
|
|
[Test]
|
|
public void DefaultIntDataStructTest()
|
|
{
|
|
var mapping = new MappingDataNode();
|
|
var val = Serialization.Read<DefaultIntDataStruct>(mapping);
|
|
|
|
Assert.That(val.A, Is.EqualTo(5));
|
|
}
|
|
}
|