Include Tims regexs to extract Class And Stick
This commit is contained in:
@@ -47,6 +47,18 @@ namespace BritishHorseRacingApi.Tests
|
||||
//Assert
|
||||
Assert.Equal(totalMilliseconds, expectedValue);
|
||||
}
|
||||
[Theory]
|
||||
[InlineData("(GoingStick:5.3 on 01-12-2018 at 08:30) Hurdle 5.3 Chase 5.3 @ 0800", 5.3)]
|
||||
[InlineData("ABANDONED - Abandoned (48 Hours)", null)]
|
||||
[InlineData("", null)]
|
||||
[InlineData("Chase - Good to Soft, Good in Places Hurdle - Good to Soft (Hurdle races on Outer/Flat course) Chase 7.5; Hurdle 7.1", 7.3)]
|
||||
public void TestGoingStickExtraction(string goingStr, double? expectedValue)
|
||||
{
|
||||
//Act
|
||||
var result = DataConverterHelper.ExtractGoingStick(goingStr);
|
||||
//Assert
|
||||
Assert.Equal(expectedValue, result);
|
||||
}
|
||||
|
||||
[Theory()]
|
||||
[InlineData("1m 1f 104y ", 2084)]
|
||||
@@ -63,6 +75,19 @@ namespace BritishHorseRacingApi.Tests
|
||||
//Assert
|
||||
Assert.Equal(expectedResult, result);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("", null)]
|
||||
[InlineData(null, null)]
|
||||
[InlineData("THE 32Red CASINO NOVICE AUCTION STAKES (CLASS 5)", 5)]
|
||||
[InlineData("THE BRITISH STALLION STUDS EBF KEGWORTH NOVICE STAKES (CLASS 4) (PLUS 10 RACE) (DIV II)", 4)]
|
||||
public void TestRaceClassExtract(string raceName, int? expectedResult)
|
||||
{
|
||||
//Act
|
||||
var result = DataConverterHelper.ExtractRaceClass(raceName);
|
||||
//Assert
|
||||
Assert.Equal(expectedResult, result);
|
||||
}
|
||||
|
||||
[Theory()]
|
||||
[InlineData("3/5", 1.6)]
|
||||
|
||||
Reference in New Issue
Block a user