Now the positions are tested and pass
This commit is contained in:
@@ -44,7 +44,19 @@ namespace TrackTrends.Tests
|
|||||||
[TestMethod()]
|
[TestMethod()]
|
||||||
public void PositionOCR_Test()
|
public void PositionOCR_Test()
|
||||||
{
|
{
|
||||||
Assert.Fail();
|
string directory = @"./../../TestImages/Positions/";
|
||||||
|
foreach (string file in Directory.GetFiles(directory))
|
||||||
|
{
|
||||||
|
Bitmap image = (Bitmap)Image.FromFile(file);
|
||||||
|
DriverPositionWindow posWindow = new DriverPositionWindow(image, new Rectangle(0, 0, image.Width, image.Height), true);
|
||||||
|
string[] paths = file.Split('/');
|
||||||
|
string fileName = paths[paths.Length - 1];
|
||||||
|
fileName = fileName.Replace(".png", "");
|
||||||
|
|
||||||
|
int foundPos = (int)posWindow.DecodePng();
|
||||||
|
|
||||||
|
Assert.AreEqual(Convert.ToInt32(fileName),foundPos);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
[TestMethod()]
|
[TestMethod()]
|
||||||
public void GapToLeaderOCR_Test()
|
public void GapToLeaderOCR_Test()
|
||||||
|
|||||||
Reference in New Issue
Block a user