mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 11:40:52 +01:00
* Removed the Interfaces folder. * All objects inside the GameObjects subfolders are now in the GameObjects namespace. * Added a Resharper DotSettings file to mark the GameObjects subfolders as not providing namespaces. * Simplified Robust.client.Graphics namespace. * Automated remove redundant using statements.
34 lines
983 B
C#
34 lines
983 B
C#
using System;
|
|
using NUnit.Framework;
|
|
using Robust.Shared.IoC;
|
|
using Robust.Shared.Reflection;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Robust.UnitTesting.Shared.Serialization
|
|
{
|
|
[TestFixture]
|
|
class NetSerializableAttribute_Test : RobustUnitTest
|
|
{
|
|
private IReflectionManager _reflection = default!;
|
|
|
|
[OneTimeSetUp]
|
|
public void TestFixtureSetup()
|
|
{
|
|
_reflection = IoCManager.Resolve<IReflectionManager>();
|
|
}
|
|
|
|
[Test]
|
|
public void AllNetSerializableObjectsHaveSerializableAttribute()
|
|
{
|
|
var types = _reflection.FindTypesWithAttribute<NetSerializableAttribute>();
|
|
|
|
foreach (var type in types)
|
|
{
|
|
Assert.IsTrue(Attribute.IsDefined(type, typeof(NetSerializableAttribute), true),
|
|
$"{type.FullName} has {nameof(NetSerializableAttribute)}, but not the required {nameof(SerializableAttribute)}.");
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|