mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-16 07:12:27 +02: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.
38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using System.Collections.Generic;
|
|
using NUnit.Framework;
|
|
using Robust.Shared.Utility;
|
|
|
|
namespace Robust.Shared.TestPrettyPrint
|
|
{
|
|
public class Foo
|
|
{
|
|
override public string ToString() { return "ACustomFooRep"; }
|
|
}
|
|
|
|
public class Bar {}
|
|
}
|
|
|
|
namespace Robust.UnitTesting.Shared.Utility
|
|
{
|
|
|
|
|
|
[TestFixture]
|
|
[Parallelizable(ParallelScope.Fixtures | ParallelScope.All)]
|
|
[TestOf(typeof(PrettyPrint))]
|
|
public class PrettyPrint_Test
|
|
{
|
|
private static IEnumerable<(object val, string expectedRep, string expectedTypeRep)> TestCases { get; } = new (object, string, string)[]
|
|
{
|
|
(new Robust.Shared.TestPrettyPrint.Foo(), "ACustomFooRep", "R.Sh.TestPrettyPrint.Foo"),
|
|
(new Robust.Shared.TestPrettyPrint.Bar(), "R.Sh.TestPrettyPrint.Bar", ""),
|
|
};
|
|
|
|
[Test]
|
|
public void Test([ValueSource(nameof(TestCases))] (object value, string expectedRep, string expectedTypeRep) data)
|
|
{
|
|
Assert.That(PrettyPrint.PrintUserFacingWithType(data.value, out var typeRep), Is.EqualTo(data.expectedRep));
|
|
Assert.That(typeRep, Is.EqualTo(data.expectedTypeRep));
|
|
}
|
|
}
|
|
}
|