Cleaned the test file
This commit is contained in:
@@ -1,4 +1,10 @@
|
|||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
/// Author : Maxime Rohmer
|
||||||
|
/// Date : 01/06/2023
|
||||||
|
/// File : OcrImageTests.cs
|
||||||
|
/// Brief : Class that is here to test the working principle of the OCR. Its not really unit test because we dont test a single class
|
||||||
|
/// Version : Alpha 1.0
|
||||||
|
|
||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
using TrackTrends;
|
using TrackTrends;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -13,6 +19,9 @@ namespace TrackTrends.Tests
|
|||||||
[TestClass()]
|
[TestClass()]
|
||||||
public class OcrImageTests
|
public class OcrImageTests
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Checks that the OCR on LapTimes is working.
|
||||||
|
/// </summary>
|
||||||
[TestMethod()]
|
[TestMethod()]
|
||||||
public void LapTimeOCR_Test()
|
public void LapTimeOCR_Test()
|
||||||
{
|
{
|
||||||
@@ -41,6 +50,9 @@ namespace TrackTrends.Tests
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Checks that the Driver Position is well detected using the OCR
|
||||||
|
/// </summary>
|
||||||
[TestMethod()]
|
[TestMethod()]
|
||||||
public void PositionOCR_Test()
|
public void PositionOCR_Test()
|
||||||
{
|
{
|
||||||
@@ -58,6 +70,9 @@ namespace TrackTrends.Tests
|
|||||||
Assert.AreEqual(Convert.ToInt32(fileName), foundPos);
|
Assert.AreEqual(Convert.ToInt32(fileName), foundPos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Checks that the tyres are correctly recognized using OCR
|
||||||
|
/// </summary>
|
||||||
[TestMethod()]
|
[TestMethod()]
|
||||||
public void TyresOCR_Test()
|
public void TyresOCR_Test()
|
||||||
{
|
{
|
||||||
@@ -97,6 +112,9 @@ namespace TrackTrends.Tests
|
|||||||
Assert.AreEqual(expectedLap,foundTyre.NumberOfLaps);
|
Assert.AreEqual(expectedLap,foundTyre.NumberOfLaps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Checks that the Gap to the leader is well decoded from the image using the OCR
|
||||||
|
/// </summary>
|
||||||
[TestMethod()]
|
[TestMethod()]
|
||||||
public void GapToLeaderOCR_Test()
|
public void GapToLeaderOCR_Test()
|
||||||
{
|
{
|
||||||
@@ -133,6 +151,9 @@ namespace TrackTrends.Tests
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Checks that the DRS window is well recognized as open of closed
|
||||||
|
/// </summary>
|
||||||
[TestMethod()]
|
[TestMethod()]
|
||||||
public void DRS_OCR_Test()
|
public void DRS_OCR_Test()
|
||||||
{
|
{
|
||||||
@@ -150,6 +171,9 @@ namespace TrackTrends.Tests
|
|||||||
Assert.IsFalse(falseResult);
|
Assert.IsFalse(falseResult);
|
||||||
Assert.IsTrue(trueResult);
|
Assert.IsTrue(trueResult);
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Checks that the driver names are recognized correctly
|
||||||
|
/// </summary>
|
||||||
[TestMethod()]
|
[TestMethod()]
|
||||||
public void DriverNameOCR_Test()
|
public void DriverNameOCR_Test()
|
||||||
{
|
{
|
||||||
@@ -193,6 +217,9 @@ namespace TrackTrends.Tests
|
|||||||
Assert.AreEqual(fileName.ToUpper(),foundName.ToUpper());
|
Assert.AreEqual(fileName.ToUpper(),foundName.ToUpper());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Checks that the Sectors are correctly decoded using the OCR
|
||||||
|
/// </summary>
|
||||||
[TestMethod()]
|
[TestMethod()]
|
||||||
public void SectorOCR_Test()
|
public void SectorOCR_Test()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user