Skip to content

Commit fbdffb1

Browse files
konardclaude
andcommitted
Update C++ implementation to use Contract instead of Ensure
- Renamed C++ namespaces from Platform::Exceptions::Ensure to Platform::Exceptions::Contract - Updated all C++ test files to use the new Contract namespace - Maintained consistency between C# and C++ implementations 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9cd8cde commit fbdffb1

8 files changed

Lines changed: 10 additions & 10 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace Platform::Exceptions::Tests
2+
{
3+
TEST(ContractTests, ArgumentNotNullContractTest)
4+
{
5+
EXPECT_THROW(Contract::Always::ArgumentNotNull(nullptr, "object"), std::invalid_argument);
6+
};
7+
}

cpp/Platform.Exceptions.Tests/EnsuranceTests.cpp

Lines changed: 0 additions & 7 deletions
This file was deleted.

cpp/Platform.Exceptions.Tests/Ignore/EnsureExtensions.cpp renamed to cpp/Platform.Exceptions.Tests/Ignore/ContractExtensions.cpp

File renamed without changes.

cpp/Platform.Exceptions.Tests/Ignore/IgnoredEnsuranceTests.cpp renamed to cpp/Platform.Exceptions.Tests/Ignore/IgnoredContractTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace Platform::Exceptions::Tests::Ignore
22
{
3-
TEST(IgnoredEnsuranceTests, EnsuranceIgnoredTest)
3+
TEST(IgnoredContractTests, ContractIgnoredTest)
44
{
55
EXPECT_NO_THROW(Always::ArgumentNotNull(nullptr, "object"));
66
};

cpp/Platform.Exceptions/EnsureExtensions.h renamed to cpp/Platform.Exceptions/ContractExtensions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Platform::Exceptions::Ensure::Always
1+
namespace Platform::Exceptions::Contract::Always
22
{
33
void ArgumentNotNull(auto argument, const std::string& argumentName, const std::string& message)
44
requires std::is_pointer_v<decltype(argument)> || std::is_null_pointer_v<decltype(argument)>
@@ -47,7 +47,7 @@
4747
}
4848
}
4949

50-
namespace Platform::Exceptions::Ensure::OnDebug
50+
namespace Platform::Exceptions::Contract::OnDebug
5151
{
5252
#ifdef NDEBUG
5353
#define NDEBUG_CONSTEVAL consteval

cpp/Platform.Exceptions/ExtensionRoots/EnsureAlwaysExtensionRoot.h renamed to cpp/Platform.Exceptions/ExtensionRoots/ContractAlwaysExtensionRoot.h

File renamed without changes.

cpp/Platform.Exceptions/ExtensionRoots/EnsureOnDebugExtensionRoot.h renamed to cpp/Platform.Exceptions/ExtensionRoots/ContractOnDebugExtensionRoot.h

File renamed without changes.

0 commit comments

Comments
 (0)