Include Catch and tests for Core
Catch 1.2.1 Former-commit-id: 4149eaa61b21532d4d204db8a3771c6de8e4672c
This commit is contained in:
34
tests/Nazara/Core/Directory.cpp
Normal file
34
tests/Nazara/Core/Directory.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#include <Nazara/Core/Directory.hpp>
|
||||
#include <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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user