mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01: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.
26 lines
931 B
C#
26 lines
931 B
C#
using System.Globalization;
|
|
using NUnit.Framework;
|
|
using Robust.Shared.Utility;
|
|
using YamlDotNet.RepresentationModel;
|
|
|
|
namespace Robust.Shared.Tests.Utility
|
|
{
|
|
[Parallelizable(ParallelScope.All | ParallelScope.Fixtures)]
|
|
[TestFixture]
|
|
public sealed class YamlHelpers_Test
|
|
{
|
|
[Test]
|
|
[SetCulture("fr-FR")]
|
|
public void Test_CultureInvariance()
|
|
{
|
|
// Make sure that we're on a locale in which the decimals would be messed up.
|
|
// French is one but I'd rather have false negatives than false positives.
|
|
Assert.That(CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator, Is.EqualTo(","));
|
|
Assert.That(float.Parse("10,5"), Is.EqualTo(10.5f));
|
|
Assert.That(() => float.Parse("10.5"), Throws.InstanceOf<FormatException>());
|
|
|
|
Assert.That(new YamlScalarNode("10.5").AsFloat(), Is.EqualTo(10.5f));
|
|
}
|
|
}
|
|
}
|