Skip to content

Commit

Permalink
rename unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Dec 16, 2024
1 parent b407f3a commit 15602bb
Show file tree
Hide file tree
Showing 17 changed files with 1,332 additions and 1,076 deletions.
23 changes: 12 additions & 11 deletions tests/xtd.core.unit_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ add_sources(
src/xtd/tests/format_u16string_object_without_xtd_to_string_tests.cpp
src/xtd/tests/format_u16string_string_tests.cpp
src/xtd/tests/format_u16string_tm_tests.cpp
src/xtd/tests/format_u16string_boolean_tests.cpp
src/xtd/tests/format_u32string_boolean_tests.cpp
src/xtd/tests/format_u32string_date_time_tests.cpp
src/xtd/tests/format_u32string_duration_tests.cpp
src/xtd/tests/format_u32string_enum_tests.cpp
Expand All @@ -182,6 +182,17 @@ add_sources(
src/xtd/tests/format_u8string_object_without_xtd_to_string_tests.cpp
src/xtd/tests/format_u8string_string_tests.cpp
src/xtd/tests/format_u8string_tm_tests.cpp
src/xtd/tests/format_wstring_boolean_tests.cpp
src/xtd/tests/format_wstring_date_time_tests.cpp
src/xtd/tests/format_wstring_duration_tests.cpp
src/xtd/tests/format_wstring_enum_tests.cpp
src/xtd/tests/format_wstring_enum_class_tests.cpp
src/xtd/tests/format_wstring_fixed_point_tests.cpp
src/xtd/tests/format_wstring_numeric_tests.cpp
src/xtd/tests/format_wstring_object_tests.cpp
src/xtd/tests/format_wstring_object_without_xtd_to_string_tests.cpp
src/xtd/tests/format_wstring_string_tests.cpp
src/xtd/tests/format_wstring_tm_tests.cpp
src/xtd/tests/generic_stream_output_tests.cpp
src/xtd/tests/get_know_folder_path.hpp
src/xtd/tests/guid_tests.cpp
Expand Down Expand Up @@ -257,16 +268,6 @@ add_sources(
src/xtd/tests/uri_tests.cpp
src/xtd/tests/ustring_tests.cpp
src/xtd/tests/version_tests.cpp
src/xtd/tests/wstring_boolean_format_tests.cpp
src/xtd/tests/wstring_date_time_format_tests.cpp
src/xtd/tests/wstring_duration_format_tests.cpp
src/xtd/tests/wstring_enum_format_tests.cpp
src/xtd/tests/wstring_enum_class_format_tests.cpp
src/xtd/tests/wstring_fixed_point_format_tests.cpp
src/xtd/tests/wstring_numeric_format_tests.cpp
src/xtd/tests/wstring_object_format_tests.cpp
src/xtd/tests/wstring_object_format_without_xtd_to_string_tests.cpp
src/xtd/tests/wstring_string_format_tests.cpp
src/xtd/tests/xml_syntax_exception_tests.cpp
src/xtd/text/tests/basic_string_builder_tests.cpp
src/xtd/threading/tasks/tests/task_canceled_exception_tests.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,85 +8,85 @@ using namespace xtd;
using namespace xtd::tunit;

namespace xtd::tests {
class test_class_(format_u16string_boolean_tests) {
class test_class_(format_u32string_boolean_tests) {
void test_method_(format_false_with_default_argument) {
assert::are_equal(u"false", format(u"{0}", false));
assert::are_equal(U"false", format(U"{0}", false));
}

void test_method_(format_true_with_default_argument) {
assert::are_equal(u"true", format(u"{0}", true));
assert::are_equal(U"true", format(U"{0}", true));
}

void test_method_(format_false_with_left_alignment) {
assert::are_equal(u" false", string::format(u"{0,10}", false));
assert::are_equal(U" false", string::format(U"{0,10}", false));
}

void test_method_(format_true_with_left_alignment) {
assert::are_equal(u" true", string::format(u"{0,10}", true));
assert::are_equal(U" true", string::format(U"{0,10}", true));
}

void test_method_(format_false_with_right_alignment) {
assert::are_equal(u"false ", string::format(u"{0, -10}", false));
assert::are_equal(U"false ", string::format(U"{0, -10}", false));
}

void test_method_(format_true_with_right_alignment) {
assert::are_equal(u"true ", string::format(u"{0, -10}", true));
assert::are_equal(U"true ", string::format(U"{0, -10}", true));
}

void test_method_(format_false_with_zero_alignment) {
assert::are_equal(u"false", string::format(u"{0,0}", false));
assert::are_equal(U"false", string::format(U"{0,0}", false));
}

void test_method_(formatn_true_with_zer_alignment) {
assert::are_equal(u"true", string::format(u"{0,0}", true));
assert::are_equal(U"true", string::format(U"{0,0}", true));
}

void test_method_(format_false_with_binary_argument) {
assert::are_equal(u"0", format(u"{0:b}", false));
assert::are_equal(U"0", format(U"{0:b}", false));
}

void test_method_(format_true_with_binaryl_argument) {
assert::are_equal(u"1", format(u"{0:B}", true));
assert::are_equal(U"1", format(U"{0:B}", true));
}

void test_method_(format_false_with_decimal_argument) {
assert::are_equal(u"0", format(u"{0:d}", false));
assert::are_equal(U"0", format(U"{0:d}", false));
}

void test_method_(format_true_with_decimal_argument) {
assert::are_equal(u"1", format(u"{0:D}", true));
assert::are_equal(U"1", format(U"{0:D}", true));
}

void test_method_(format_false_with_general_argument) {
assert::are_equal(u"false", format(u"{0:g}", false));
assert::are_equal(U"false", format(U"{0:g}", false));
}

void test_method_(format_true_with_general_argument) {
assert::are_equal(u"true", format(u"{0:G}", true));
assert::are_equal(U"true", format(U"{0:G}", true));
}

void test_method_(format_false_with_octal_argument) {
assert::are_equal(u"0", format(u"{0:o}", false));
assert::are_equal(U"0", format(U"{0:o}", false));
}

void test_method_(format_true_with_octal_argument) {
assert::are_equal(u"1", format(u"{0:O}", true));
assert::are_equal(U"1", format(U"{0:O}", true));
}

void test_method_(format_false_with_hexadecimal_argument) {
assert::are_equal(u"0", format(u"{0:x}", false));
assert::are_equal(U"0", format(U"{0:x}", false));
}

void test_method_(format_true_with_hexadecimal_argument) {
assert::are_equal(u"1", format(u"{0:X}", true));
assert::are_equal(U"1", format(U"{0:X}", true));
}

void test_method_(format_false_with_invalid_argument) {
assert::throws<xtd::format_exception>([] {format(u"{0:e}", true);});
assert::throws<xtd::format_exception>([] {format(U"{0:e}", true);});
}

void test_method_(format_true_with_invalid_argument) {
assert::throws<xtd::format_exception>([] {format(u"{0:z1}", true);});
assert::throws<xtd::format_exception>([] {format(U"{0:z1}", true);});
}
};
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <xtd/string>
#include <xtd/format>
#include <xtd/format_exception>
#include <xtd/tunit/assert>
#include <xtd/tunit/test_class_attribute>
Expand All @@ -8,13 +8,13 @@ using namespace xtd;
using namespace xtd::tunit;

namespace xtd::tests {
class test_class_(wstring_boolean_format_tests) {
class test_class_(format_wstring_boolean_tests) {
void test_method_(format_false_with_default_argument) {
assert::are_equal(L"false", xtd::string::format(L"{0}", false));
assert::are_equal(L"false", format(L"{0}", false));
}

void test_method_(format_true_with_default_argument) {
assert::are_equal(L"true", xtd::string::format(L"{0}", true));
assert::are_equal(L"true", format(L"{0}", true));
}

void test_method_(format_false_with_left_alignment) {
Expand Down Expand Up @@ -42,51 +42,51 @@ namespace xtd::tests {
}

void test_method_(format_false_with_binary_argument) {
assert::are_equal(L"0", xtd::string::format(L"{0:b}", false));
assert::are_equal(L"0", format(L"{0:b}", false));
}

void test_method_(format_true_with_binaryl_argument) {
assert::are_equal(L"1", xtd::string::format(L"{0:B}", true));
assert::are_equal(L"1", format(L"{0:B}", true));
}

void test_method_(format_false_with_decimal_argument) {
assert::are_equal(L"0", xtd::string::format(L"{0:d}", false));
assert::are_equal(L"0", format(L"{0:d}", false));
}

void test_method_(format_true_with_decimal_argument) {
assert::are_equal(L"1", xtd::string::format(L"{0:D}", true));
assert::are_equal(L"1", format(L"{0:D}", true));
}

void test_method_(format_false_with_general_argument) {
assert::are_equal(L"false", xtd::string::format(L"{0:g}", false));
assert::are_equal(L"false", format(L"{0:g}", false));
}

void test_method_(format_true_with_general_argument) {
assert::are_equal(L"true", xtd::string::format(L"{0:G}", true));
assert::are_equal(L"true", format(L"{0:G}", true));
}

void test_method_(format_false_with_octal_argument) {
assert::are_equal(L"0", xtd::string::format(L"{0:o}", false));
assert::are_equal(L"0", format(L"{0:o}", false));
}

void test_method_(format_true_with_octal_argument) {
assert::are_equal(L"1", xtd::string::format(L"{0:O}", true));
assert::are_equal(L"1", format(L"{0:O}", true));
}

void test_method_(format_false_with_hexadecimal_argument) {
assert::are_equal(L"0", xtd::string::format(L"{0:x}", false));
assert::are_equal(L"0", format(L"{0:x}", false));
}

void test_method_(format_true_with_hexadecimal_argument) {
assert::are_equal(L"1", xtd::string::format(L"{0:X}", true));
assert::are_equal(L"1", format(L"{0:X}", true));
}

void test_method_(format_false_with_invalid_argument) {
assert::throws<xtd::format_exception>([] {xtd::string::format(L"{0:e}", true);});
assert::throws<xtd::format_exception>([] {format(L"{0:e}", true);});
}

void test_method_(format_true_with_invalid_argument) {
assert::throws<xtd::format_exception>([] {xtd::string::format(L"{0:z1}", true);});
assert::throws<xtd::format_exception>([] {format(L"{0:z1}", true);});
}
};
}
Loading

0 comments on commit 15602bb

Please sign in to comment.