Fixed localization of tests.
This commit is contained in:
parent
8ae31c872a
commit
1c4fe75380
4 changed files with 10 additions and 7 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -5,3 +5,4 @@
|
||||||
output/*
|
output/*
|
||||||
AspectedRouting.sln.DotSettings
|
AspectedRouting.sln.DotSettings
|
||||||
AspectedRouting.sln.DotSettings.user
|
AspectedRouting.sln.DotSettings.user
|
||||||
|
.DS_Store
|
|
@ -216,12 +216,13 @@ namespace AspectedRouting
|
||||||
Console.WriteLine("\n\n\n------------------------");
|
Console.WriteLine("\n\n\n------------------------");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void Main(string[] args)
|
private static int Main(string[] args)
|
||||||
{
|
{
|
||||||
var errMessage = MainWithError(args);
|
var errMessage = MainWithError(args);
|
||||||
if (errMessage != null) {
|
if (errMessage == null) return 0;
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
}
|
Console.WriteLine(errMessage);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string MainWithError(string[] args)
|
public static string MainWithError(string[] args)
|
||||||
|
|
|
@ -108,7 +108,7 @@ namespace AspectedRouting.Tests
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var doesMatch = (actual is double d && Math.Abs(double.Parse(test.expected) - d) < 0.0001)
|
var doesMatch = (actual is double d && Math.Abs(double.Parse(test.expected, NumberStyles.Any, CultureInfo.InvariantCulture) - d) < 0.0001)
|
||||||
|| actual.ToString().Equals(test.expected);
|
|| actual.ToString().Equals(test.expected);
|
||||||
|
|
||||||
if (!doesMatch) {
|
if (!doesMatch) {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using AspectedRouting.Language;
|
using AspectedRouting.Language;
|
||||||
using AspectedRouting.Language.Expression;
|
using AspectedRouting.Language.Expression;
|
||||||
|
@ -68,13 +69,13 @@ namespace AspectedRouting.Tests
|
||||||
var speed = 0.0;
|
var speed = 0.0;
|
||||||
if (!string.IsNullOrEmpty(testData[2]))
|
if (!string.IsNullOrEmpty(testData[2]))
|
||||||
{
|
{
|
||||||
speed = double.Parse(testData[2]);
|
speed = double.Parse(testData[2], NumberStyles.Any, CultureInfo.InvariantCulture);
|
||||||
}
|
}
|
||||||
|
|
||||||
var weight = 0.0;
|
var weight = 0.0;
|
||||||
if (!string.IsNullOrEmpty(testData[3]))
|
if (!string.IsNullOrEmpty(testData[3]))
|
||||||
{
|
{
|
||||||
weight = double.Parse(testData[3]);
|
weight = double.Parse(testData[3], NumberStyles.Any, CultureInfo.InvariantCulture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue