Include Tims regexs to extract Class And Stick
SuccessfulCode/BritishHorseRacingApi/pipeline/head There was a failure building this commit
Successfulcode/BritishHorseRacingApi/pipeline/head There was a failure building this commit

This commit is contained in:
2020-05-10 22:42:46 +01:00
parent a2e23ff955
commit fee03021b1
4 changed files with 89 additions and 1 deletions
@@ -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)]