Moved Eule to its own repository

This commit is contained in:
Leonetienne
2021-11-15 11:32:27 +01:00
commit ba102c8389
48 changed files with 11528 additions and 0 deletions

61
Test/Math_Similar.cpp Normal file
View File

@@ -0,0 +1,61 @@
#include "CppUnitTest.h"
#include "../Eule/Math.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
using namespace Eule;
namespace _Math
{
TEST_CLASS(_Similar)
{
public:
// Checks that the similar function works with an exact comparison -> true
TEST_METHOD(Exact_Comparison_True)
{
Assert::IsTrue(Math::Similar(100, 100, 0));
return;
}
// Checks that the similar function works with an exact comparison -> false
TEST_METHOD(Exact_Comparison_False)
{
Assert::IsFalse(Math::Similar(100, 100.001, 0));
return;
}
// Checks that the similar function works with an exact comparison -> false
TEST_METHOD(Exact_Comparison_False2)
{
Assert::IsFalse(Math::Similar(100, 99.999, 0));
return;
}
// Checks that the similar function works with a loose comparison -> true
TEST_METHOD(Loose_Comparison_True)
{
Assert::IsTrue(Math::Similar(100, 100.001, 0.01));
return;
}
// Checks that the similar function works with a loose comparison -> true
TEST_METHOD(Loose_Comparison_True2)
{
Assert::IsTrue(Math::Similar(100, 99.999, 0.01));
return;
}
// Checks that the similar function works with a loose comparison -> false
TEST_METHOD(Loose_Comparison_False)
{
Assert::IsFalse(Math::Similar(100, 100.1, 0.01));
return;
}
// Checks that the similar function works with a loose comparison -> false
TEST_METHOD(Loose_Comparison_False2)
{
Assert::IsFalse(Math::Similar(100, 99.9, 0.01));
return;
}
};
}