Cleaned the test file

This commit is contained in:
2023-06-01 13:44:49 +02:00
parent da23c40ac2
commit cf25a52470

View File

@@ -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 System;
using System.Collections.Generic;
@@ -13,6 +19,9 @@ namespace TrackTrends.Tests
[TestClass()]
public class OcrImageTests
{
/// <summary>
/// Checks that the OCR on LapTimes is working.
/// </summary>
[TestMethod()]
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()]
public void PositionOCR_Test()
{
@@ -58,6 +70,9 @@ namespace TrackTrends.Tests
Assert.AreEqual(Convert.ToInt32(fileName), foundPos);
}
}
/// <summary>
/// Checks that the tyres are correctly recognized using OCR
/// </summary>
[TestMethod()]
public void TyresOCR_Test()
{
@@ -97,6 +112,9 @@ namespace TrackTrends.Tests
Assert.AreEqual(expectedLap,foundTyre.NumberOfLaps);
}
}
/// <summary>
/// Checks that the Gap to the leader is well decoded from the image using the OCR
/// </summary>
[TestMethod()]
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()]
public void DRS_OCR_Test()
{
@@ -150,6 +171,9 @@ namespace TrackTrends.Tests
Assert.IsFalse(falseResult);
Assert.IsTrue(trueResult);
}
/// <summary>
/// Checks that the driver names are recognized correctly
/// </summary>
[TestMethod()]
public void DriverNameOCR_Test()
{
@@ -193,6 +217,9 @@ namespace TrackTrends.Tests
Assert.AreEqual(fileName.ToUpper(),foundName.ToUpper());
}
}
/// <summary>
/// Checks that the Sectors are correctly decoded using the OCR
/// </summary>
[TestMethod()]
public void SectorOCR_Test()
{