2#ifndef _aspose_testing_test_context_h_
3#define _aspose_testing_test_context_h_
5#include <system/object.h>
6#include <system/shared_ptr.h>
7#include <system/string.h>
8#include <gtest/gtest.h>
12namespace NUnit {
namespace Framework {
42 MEMBER_FUNCTION_MAKE_OBJECT(TestAdapter, CODEPORTING_ARGS(
const System::String& full_name,
const System::String& name), CODEPORTING_ARGS(full_name, name));
62 const auto test_dir = get_TestDirectory_static();
70 const auto info = ::testing::UnitTest::GetInstance()->current_test_info();
73 return TestAdapter::MakeObject(full_name, name);
81 const auto argvs = ::testing::internal::GetArgvs();
83 if (argvs.empty() || argvs[0].empty())
88 ::testing::internal::FilePath filePath(argvs[0]);
89 const auto directoryName = filePath.RemoveFileName();
TestAdapter adapts a Test for consumption by the user test code.
Definition: TestContext.h:19
System::String get_FullName()
Gets full name of the test.
Definition: TestContext.h:25
System::String get_Name()
Gets name of the test.
Definition: TestContext.h:32
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:62
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
static String FromUtf8(const char *utf8)
Creates String from utf8 string.
Definition: exceptions.h:943
Context in which testing takes place.
Definition: TestContext.h:16
System::String get_TestDirectory()
Returns test directory.
Definition: TestContext.h:60
System::SharedPtr< TestContext::TestAdapter > get_Test()
Returns current test info.
Definition: TestContext.h:68
static TestContext * get_CurrentContext()
Returns current test context.
Definition: TestContext.h:52