UnitTests: Add build script and move current tests to "tests/Engine" directory (from "tests/Nazara")

Former-commit-id: 5639305bbdbb69ad6f6f282df6c6de930220b57f
This commit is contained in:
Lynix
2015-09-19 01:14:19 +02:00
parent a09f859144
commit a61f968d05
24 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
#include <Nazara/Core/Directory.hpp>
#include <Catch/catch.hpp>
SCENARIO("Directory", "[CORE][DIRECTORY]")
{
GIVEN("The current directory")
{
NzDirectory currentDirectory(NzDirectory::GetCurrent());
CHECK(currentDirectory.Exists());
currentDirectory.Open();
WHEN("We create a new directory Test Directory")
{
NzDirectory::Create("Test Directory");
THEN("A new directory has been created")
{
CHECK(NzDirectory::Exists(currentDirectory.GetCurrent() + "/Test Directory"));
CHECK(currentDirectory.IsOpen());
}
}
AND_WHEN("We delete it")
{
NzDirectory::Remove(currentDirectory.GetCurrent() + "/Test Directory", true);
THEN("It doesn't exist anymore")
{
CHECK(!NzDirectory::Exists(currentDirectory.GetCurrent() + "/Test Directory"));
}
}
}
}