This commit is contained in:
@@ -66,7 +66,7 @@ namespace BritishHorseRacingApi.Tests
|
||||
|
||||
[Theory()]
|
||||
[InlineData("3/5", 1.6)]
|
||||
[InlineData("20/1",21)]
|
||||
[InlineData("20/1", 21)]
|
||||
[InlineData("5.5/1", 6.5)]
|
||||
[InlineData("", null)]
|
||||
[InlineData(" ", null)]
|
||||
@@ -80,5 +80,24 @@ namespace BritishHorseRacingApi.Tests
|
||||
//Assert
|
||||
Assert.Equal(decimalExpectedValue, result);
|
||||
}
|
||||
|
||||
[Theory()]
|
||||
[InlineData("9st 4lbs", 58967.00662)]
|
||||
[InlineData("11st 3lbs", 71214.00098)]
|
||||
[InlineData("10lbs", 4535.92000)]
|
||||
[InlineData("9st", 57152.63862)]
|
||||
[InlineData("9st 0lbs", 57152.63862)]
|
||||
[InlineData("", null)]
|
||||
[InlineData(" ", null)]
|
||||
[InlineData(null, null)]
|
||||
public void TestWeightStringToGrams(string value, double? expectedResult)
|
||||
{
|
||||
//Arrange
|
||||
var decimalExpectedValue = (decimal?)expectedResult;
|
||||
//Act
|
||||
var result = DataConverterHelper.WeightStringToGrams(value);
|
||||
//Assert
|
||||
Assert.Equal(decimalExpectedValue, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user