Files
AcruidandGitHub 2183cd7ca1 Massive Namespace Cleanup (#1544)
* 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.
2021-02-10 23:27:19 -08:00

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));
}
}
}