From 337358d3f13828b122363ed49d6df71fb280b1e5 Mon Sep 17 00:00:00 2001 From: Gammasoft Date: Sat, 9 Nov 2024 12:07:09 +0100 Subject: [PATCH] Add unit tests --- .../sockets/tests/socket_exception_tests.cpp | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/tests/xtd.core.unit_tests/src/xtd/net/sockets/tests/socket_exception_tests.cpp b/tests/xtd.core.unit_tests/src/xtd/net/sockets/tests/socket_exception_tests.cpp index 112066072fe..2163a83918d 100644 --- a/tests/xtd.core.unit_tests/src/xtd/net/sockets/tests/socket_exception_tests.cpp +++ b/tests/xtd.core.unit_tests/src/xtd/net/sockets/tests/socket_exception_tests.cpp @@ -5736,6 +5736,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::sock_error, e.socket_error()); + assert::are_equal(enum_object {socket_error::sock_error}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -5754,6 +5756,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::success, e.socket_error()); + assert::are_equal(enum_object {socket_error::success}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -5772,6 +5776,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::operation_aborted, e.socket_error()); + assert::are_equal(enum_object {socket_error::operation_aborted}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -5790,6 +5796,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::io_pending, e.socket_error()); + assert::are_equal(enum_object {socket_error::io_pending}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -5808,6 +5816,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::interrupted, e.socket_error()); + assert::are_equal(enum_object {socket_error::interrupted}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -5826,6 +5836,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::access_denied, e.socket_error()); + assert::are_equal(enum_object {socket_error::access_denied}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -5844,6 +5856,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::fault, e.socket_error()); + assert::are_equal(enum_object {socket_error::fault}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -5862,6 +5876,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::invalid_argument, e.socket_error()); + assert::are_equal(enum_object {socket_error::invalid_argument}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -5880,6 +5896,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::too_many_open_sockets, e.socket_error()); + assert::are_equal(enum_object {socket_error::too_many_open_sockets}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -5898,6 +5916,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::would_block, e.socket_error()); + assert::are_equal(enum_object {socket_error::would_block}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -5916,6 +5936,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::in_progress, e.socket_error()); + assert::are_equal(enum_object {socket_error::in_progress}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -5934,6 +5956,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::already_in_progress, e.socket_error()); + assert::are_equal(enum_object {socket_error::already_in_progress}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -5952,6 +5976,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::not_socket, e.socket_error()); + assert::are_equal(enum_object {socket_error::not_socket}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -5970,6 +5996,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::destination_address_required, e.socket_error()); + assert::are_equal(enum_object {socket_error::destination_address_required}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -5988,6 +6016,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::message_size, e.socket_error()); + assert::are_equal(enum_object {socket_error::message_size}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6006,6 +6036,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::protocol_type, e.socket_error()); + assert::are_equal(enum_object {socket_error::protocol_type}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6024,6 +6056,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::protocol_option, e.socket_error()); + assert::are_equal(enum_object {socket_error::protocol_option}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6042,6 +6076,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::protocol_not_supported, e.socket_error()); + assert::are_equal(enum_object {socket_error::protocol_not_supported}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6060,6 +6096,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::socket_not_supported, e.socket_error()); + assert::are_equal(enum_object {socket_error::socket_not_supported}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6078,6 +6116,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::operation_not_supported, e.socket_error()); + assert::are_equal(enum_object {socket_error::operation_not_supported}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6096,6 +6136,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::protocol_family_not_supported, e.socket_error()); + assert::are_equal(enum_object {socket_error::protocol_family_not_supported}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6114,6 +6156,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::address_family_not_supported, e.socket_error()); + assert::are_equal(enum_object {socket_error::address_family_not_supported}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6132,6 +6176,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::address_already_in_use, e.socket_error()); + assert::are_equal(enum_object {socket_error::address_already_in_use}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6150,6 +6196,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::address_not_available, e.socket_error()); + assert::are_equal(enum_object {socket_error::address_not_available}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6168,6 +6216,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::network_down, e.socket_error()); + assert::are_equal(enum_object {socket_error::network_down}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6186,6 +6236,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::network_unreachable, e.socket_error()); + assert::are_equal(enum_object {socket_error::network_unreachable}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6204,6 +6256,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::network_reset, e.socket_error()); + assert::are_equal(enum_object {socket_error::network_reset}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6222,6 +6276,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::connection_aborted, e.socket_error()); + assert::are_equal(enum_object {socket_error::connection_aborted}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6240,6 +6296,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::connection_reset, e.socket_error()); + assert::are_equal(enum_object {socket_error::connection_reset}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6258,6 +6316,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::no_buffer_space_available, e.socket_error()); + assert::are_equal(enum_object {socket_error::no_buffer_space_available}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6276,6 +6336,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::is_connected, e.socket_error()); + assert::are_equal(enum_object {socket_error::is_connected}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6294,6 +6356,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::not_connected, e.socket_error()); + assert::are_equal(enum_object {socket_error::not_connected}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6312,6 +6376,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::shutdown, e.socket_error()); + assert::are_equal(enum_object {socket_error::shutdown}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6330,6 +6396,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::timed_out, e.socket_error()); + assert::are_equal(enum_object {socket_error::timed_out}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6348,6 +6416,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::connection_refused, e.socket_error()); + assert::are_equal(enum_object {socket_error::connection_refused}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6366,6 +6436,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::host_down, e.socket_error()); + assert::are_equal(enum_object {socket_error::host_down}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6384,6 +6456,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::host_unreachable, e.socket_error()); + assert::are_equal(enum_object {socket_error::host_unreachable}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6402,6 +6476,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::process_limit, e.socket_error()); + assert::are_equal(enum_object {socket_error::process_limit}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6420,6 +6496,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::system_not_ready, e.socket_error()); + assert::are_equal(enum_object {socket_error::system_not_ready}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6438,6 +6516,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::version_not_supported, e.socket_error()); + assert::are_equal(enum_object {socket_error::version_not_supported}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6456,6 +6536,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::not_initialized, e.socket_error()); + assert::are_equal(enum_object {socket_error::not_initialized}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6474,6 +6556,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::disconnecting, e.socket_error()); + assert::are_equal(enum_object {socket_error::disconnecting}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6492,6 +6576,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::type_not_found, e.socket_error()); + assert::are_equal(enum_object {socket_error::type_not_found}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6510,6 +6596,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::host_not_found, e.socket_error()); + assert::are_equal(enum_object {socket_error::host_not_found}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6528,6 +6616,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::try_again, e.socket_error()); + assert::are_equal(enum_object {socket_error::try_again}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6546,6 +6636,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::no_recovery, e.socket_error()); + assert::are_equal(enum_object {socket_error::no_recovery}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name()); @@ -6564,6 +6656,8 @@ namespace xtd::net::sockets::tests { assert::are_equal(e.h_result(), e.error_code().value()); assert::is_null(e.inner_exception()); assert::are_equal("Test excpetion message.", e.message()); + assert::are_equal(socket_error::no_data, e.socket_error()); + assert::are_equal(enum_object {socket_error::no_data}.to_int32(), e.socket_error_code()); assert::are_equal(path::get_file_name(assembly::get_executing_assembly().location()), e.source()); assert::is_not_empty(e.stack_trace()); assert::is_not_empty(e.get_last_stack_frame().get_file_name());