66 lines
1.9 KiB
C#
66 lines
1.9 KiB
C#
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
using TrackTrends;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.IO;
|
|
using System.Drawing;
|
|
|
|
namespace TrackTrends.Tests
|
|
{
|
|
[TestClass()]
|
|
public class OcrImageTests
|
|
{
|
|
[TestMethod()]
|
|
public void LapTimeOCR_Test()
|
|
{
|
|
Assert.Fail();
|
|
}
|
|
[TestMethod()]
|
|
public void PositionOCR_Test()
|
|
{
|
|
Assert.Fail();
|
|
}
|
|
[TestMethod()]
|
|
public void GapToLeaderOCR_Test()
|
|
{
|
|
Assert.Fail();
|
|
}
|
|
[TestMethod()]
|
|
public void DRS_OCR_Test()
|
|
{
|
|
string directory = @"./../../TestImages/DRS/";
|
|
DirectoryInfo directoryInfo = new DirectoryInfo(directory);
|
|
if (Directory.Exists(directory))
|
|
{
|
|
Bitmap falseExemple = (Bitmap)Image.FromFile(directory + "False.png");
|
|
Bitmap trueExemple = (Bitmap)Image.FromFile(directory + "True.png");
|
|
|
|
DriverDrsWindow falseDRS = new DriverDrsWindow(falseExemple, new Rectangle(0, 0, falseExemple.Width, falseExemple.Height), true);
|
|
DriverDrsWindow trueDRS = new DriverDrsWindow(trueExemple, new Rectangle(0, 0, trueExemple.Width, trueExemple.Height), true);
|
|
|
|
bool falseResult = (bool)falseDRS.DecodePng();
|
|
bool trueResult = (bool)trueDRS.DecodePng();
|
|
|
|
Assert.IsFalse(falseResult);
|
|
Assert.IsTrue(trueResult);
|
|
}
|
|
else
|
|
{
|
|
Assert.Fail();
|
|
}
|
|
}
|
|
[TestMethod()]
|
|
public void DriverNameOCR_Test()
|
|
{
|
|
Assert.Fail();
|
|
}
|
|
[TestMethod()]
|
|
public void SectorOCR_Test()
|
|
{
|
|
Assert.Fail();
|
|
}
|
|
}
|
|
} |