From 1ec61fc73fac07446c813c6f1a35c38ece200913 Mon Sep 17 00:00:00 2001 From: Gammasoft Date: Wed, 25 Sep 2024 16:50:42 +0200 Subject: [PATCH] Add argument_null_exception unit tests --- .../src/xtd/tests/argument_null_exception_tests.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/xtd.core.unit_tests/src/xtd/tests/argument_null_exception_tests.cpp b/tests/xtd.core.unit_tests/src/xtd/tests/argument_null_exception_tests.cpp index 109aef5b9bc..146e26dfe26 100644 --- a/tests/xtd.core.unit_tests/src/xtd/tests/argument_null_exception_tests.cpp +++ b/tests/xtd.core.unit_tests/src/xtd/tests/argument_null_exception_tests.cpp @@ -309,6 +309,11 @@ namespace xtd::tests { assert::throws([]{argument_null_exception::throw_if_null(ptr {});}, csf_); } + void test_method_(throw_if_null_with_optional) { + assert::does_not_throw([]{argument_null_exception::throw_if_null(std::optional {object {}});}, csf_); + assert::throws([]{argument_null_exception::throw_if_null(std::optional {});}, csf_); + } + void test_method_(throw_if_null_with_sptr) { assert::does_not_throw([]{argument_null_exception::throw_if_null(new_sptr());}, csf_); assert::throws([]{argument_null_exception::throw_if_null(sptr {});}, csf_);