mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-04 11:07:12 +02:00
24 lines
629 B
C#
24 lines
629 B
C#
using NUnit.Framework;
|
|
using Robust.Shared.Serialization.Markdown.Value;
|
|
|
|
// ReSharper disable AccessToStaticMemberViaDerivedType
|
|
|
|
namespace Robust.UnitTesting.Shared.Serialization
|
|
{
|
|
[TestFixture]
|
|
public class NullableSerializationTest : SerializationTest
|
|
{
|
|
[Test]
|
|
public void NullableIntTest()
|
|
{
|
|
var nullValue = Serialization.Read(typeof(int?), new ValueDataNode("null"));
|
|
|
|
Assert.Null(nullValue.RawValue);
|
|
|
|
var value = Serialization.Read(typeof(int?), new ValueDataNode("5"));
|
|
|
|
Assert.That(value.RawValue, Is.EqualTo(5));
|
|
}
|
|
}
|
|
}
|