From 1c1cdce578ca29c3e6040441784e19ce52e3000f Mon Sep 17 00:00:00 2001 From: Luk Vermeulen Date: Wed, 16 Oct 2019 07:01:53 +0200 Subject: [PATCH] fix warnings --- .editorconfig | 203 ++++++++++++++++++ src/Flurl.Http.Xml/Flurl.Http.Xml.csproj | 1 + src/Flurl.Http.Xml/FlurlRequestExtensions.cs | 14 +- src/Flurl.Http.Xml/MicrosoftXmlSerializer.cs | 4 +- src/Flurl.Http.Xml/StringExtensions.cs | 14 +- src/Flurl.Http.Xml/UrlExtensions.cs | 14 +- .../Flurl.Http.Xml.Tests.csproj | 5 +- .../Flurl.Http.Xml.Tests.xunit.runner.json | 5 + test/Flurl.Http.Xml.Tests/xunit.runner.json | 3 - 9 files changed, 234 insertions(+), 29 deletions(-) create mode 100644 .editorconfig create mode 100644 test/Flurl.Http.Xml.Tests/Flurl.Http.Xml.Tests.xunit.runner.json delete mode 100644 test/Flurl.Http.Xml.Tests/xunit.runner.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..adad031 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,203 @@ + +[*.proto] +indent_style=tab +indent_size=tab +tab_width=4 + +[*.{asax,ascx,aspx,cs,cshtml,css,htm,html,js,jsx,master,razor,skin,ts,tsx,vb,xaml,xamlx,xoml}] +indent_style=space +indent_size=4 +tab_width=4 + +[*.{appxmanifest,build,config,csproj,dbml,discomap,dtd,json,jsproj,lsproj,njsproj,nuspec,proj,props,resjson,resw,resx,StyleCop,targets,tasks,vbproj,xml,xsd}] +indent_style=space +indent_size=2 +tab_width=2 + +[*] + +# Microsoft .NET properties +csharp_new_line_before_members_in_object_initializers=false +csharp_preferred_modifier_order=public, private, protected, internal, new, abstract, virtual, sealed, override, static, readonly, extern, unsafe, volatile, async:suggestion +csharp_space_after_cast=false +csharp_style_var_elsewhere=true:hint +csharp_style_var_for_built_in_types=false:suggestion +csharp_style_var_when_type_is_apparent=true:hint +dotnet_style_predefined_type_for_locals_parameters_members=true:hint +dotnet_style_predefined_type_for_member_access=true:hint +dotnet_style_qualification_for_event=false:hint +dotnet_style_qualification_for_field=false:hint +dotnet_style_qualification_for_method=false:hint +dotnet_style_qualification_for_property=false:hint +dotnet_style_require_accessibility_modifiers=for_non_interface_members:hint + +# ReSharper properties +resharper_align_multiline_binary_expressions_chain=false +resharper_apply_on_completion=true +resharper_braces_for_for=required +resharper_braces_for_foreach=required +resharper_braces_for_ifelse=required +resharper_braces_for_while=required +resharper_braces_redundant=false +resharper_csharp_wrap_lines=false +resharper_prefer_explicit_discard_declaration=true +resharper_space_within_single_line_array_initializer_braces=true + +# ReSharper inspection severities +resharper_access_to_modified_closure_highlighting=hint +resharper_assigned_value_is_never_used_highlighting=none +resharper_assignment_in_condition_expression_highlighting=none +resharper_assign_to_constant_highlighting=none +resharper_assign_to_implicit_global_in_function_scope_highlighting=none +resharper_bad_namespace_braces_indent_highlighting=warning +resharper_block_scope_redeclaration_highlighting=none +resharper_caller_callee_using_error_highlighting=none +resharper_caller_callee_using_highlighting=none +resharper_class_never_instantiated_global_highlighting=none +resharper_closure_on_modified_variable_highlighting=none +resharper_coerced_equals_using_highlighting=none +resharper_collection_never_queried_global_highlighting=none +resharper_collection_never_updated_global_highlighting=hint +resharper_comma_not_valid_here_highlighting=none +resharper_comment_typo_highlighting=none +resharper_conditional_ternary_equal_branch_highlighting=none +resharper_condition_is_always_const_highlighting=none +resharper_constructor_call_not_used_highlighting=none +resharper_css_browser_compatibility_highlighting=none +resharper_css_caniuse_feature_requires_prefix_highlighting=none +resharper_css_caniuse_unsupported_feature_highlighting=none +resharper_css_not_resolved_highlighting=none +resharper_css_obsolete_highlighting=none +resharper_css_property_does_not_override_vendor_property_highlighting=none +resharper_declaration_hides_highlighting=none +resharper_declaration_is_empty_highlighting=none +resharper_deleting_non_qualified_reference_highlighting=none +resharper_double_colons_expected_highlighting=none +resharper_double_colons_preferred_highlighting=none +resharper_duplicating_local_declaration_highlighting=none +resharper_duplicating_parameter_declaration_error_highlighting=none +resharper_duplicating_property_declaration_error_highlighting=none +resharper_duplicating_property_declaration_highlighting=none +resharper_duplicating_switch_label_highlighting=none +resharper_elided_trailing_element_highlighting=none +resharper_empty_object_property_declaration_highlighting=none +resharper_enforce_do_while_statement_braces_highlighting=warning +resharper_enforce_fixed_statement_braces_highlighting=warning +resharper_enforce_foreach_statement_braces_highlighting=warning +resharper_enforce_for_statement_braces_highlighting=warning +resharper_enforce_if_statement_braces_highlighting=warning +resharper_enforce_lock_statement_braces_highlighting=warning +resharper_enforce_using_statement_braces_highlighting=warning +resharper_enforce_while_statement_braces_highlighting=warning +resharper_error_in_xml_doc_reference_highlighting=none +resharper_es6_feature_highlighting=none +resharper_es7_feature_highlighting=none +resharper_eval_arguments_name_error_highlighting=none +resharper_experimental_feature_highlighting=none +resharper_expression_is_always_const_highlighting=none +resharper_function_parameter_named_arguments_highlighting=none +resharper_function_used_out_of_scope_highlighting=none +resharper_heuristically_unreachable_code_highlighting=none +resharper_hex_color_value_with_alpha_highlighting=none +resharper_html_attribute_not_resolved_highlighting=none +resharper_identifier_typo_highlighting=none +resharper_import_keyword_not_with_invocation_highlighting=none +resharper_inconsistent_function_returns_highlighting=none +resharper_inconsistent_naming_highlighting=none +resharper_incorrect_operand_in_type_of_comparison_highlighting=none +resharper_incorrect_triple_slash_location_highlighting=none +resharper_invalid_json_syntax_highlighting=none +resharper_invalid_value_highlighting=none +resharper_invocation_of_non_function_highlighting=none +resharper_invoked_expression_maybe_non_function_highlighting=none +resharper_join_declaration_and_initializer_js_highlighting=none +resharper_json_validation_failed_highlighting=none +resharper_js_path_not_found_highlighting=none +resharper_js_unreachable_code_highlighting=none +resharper_jump_must_be_in_loop_highlighting=none +resharper_label_or_semicolon_expected_highlighting=none +resharper_lexical_declaration_needs_block_highlighting=none +resharper_local_function_redefined_later_highlighting=none +resharper_l_value_is_expected_highlighting=none +resharper_member_can_be_made_static_local_highlighting=none +resharper_member_can_be_private_global_highlighting=none +resharper_member_can_be_protected_global_highlighting=none +resharper_missing_has_own_property_in_foreach_highlighting=none +resharper_misuse_of_owner_function_this_highlighting=none +resharper_multiple_declarations_in_foreach_highlighting=none +resharper_native_type_prototype_extending_highlighting=none +resharper_native_type_prototype_overwriting_highlighting=none +resharper_non_assigned_constant_highlighting=none +resharper_non_readonly_member_in_get_hash_code_highlighting=hint +resharper_not_all_paths_return_value_highlighting=none +resharper_not_resolved_highlighting=none +resharper_object_destructuring_without_parentheses_highlighting=none +resharper_object_literals_are_not_comma_free_highlighting=none +resharper_octal_literals_not_allowed_error_highlighting=none +resharper_parameter_only_used_for_precondition_check_local_highlighting=none +resharper_parameter_value_is_not_used_highlighting=none +resharper_path_not_resolved_highlighting=none +resharper_possibly_incorrectly_broken_statement_highlighting=none +resharper_possibly_unassigned_property_highlighting=none +resharper_property_getter_cannot_have_parameters_highlighting=none +resharper_property_setter_must_have_single_parameter_highlighting=none +resharper_qualified_expression_is_null_highlighting=none +resharper_qualified_expression_maybe_null_highlighting=none +resharper_redundant_base_qualifier_highlighting=warning +resharper_redundant_block_highlighting=none +resharper_redundant_css_hack_highlighting=none +resharper_redundant_declaration_semicolon_highlighting=warning +resharper_redundant_else_block_highlighting=none +resharper_redundant_empty_finally_block_highlighting=none +resharper_redundant_highlighting=none +resharper_redundant_intermediate_variable_highlighting=none +resharper_redundant_local_class_name_highlighting=none +resharper_redundant_local_function_name_highlighting=none +resharper_redundant_type_specification_in_default_expression_highlighting=hint +resharper_redundant_units_highlighting=none +resharper_replace_indicing_with_array_destructuring_highlighting=none +resharper_replace_indicing_with_short_hand_properties_after_destructuring_highlighting=none +resharper_replace_undefined_checking_series_with_object_destructuring_highlighting=none +resharper_replace_with_destructuring_swap_highlighting=none +resharper_requires_fallback_color_highlighting=none +resharper_return_from_global_scopet_with_value_highlighting=none +resharper_same_variable_assignment_highlighting=none +resharper_similar_expressions_comparison_highlighting=none +resharper_statement_termination_highlighting=none +resharper_string_concatenation_to_template_string_highlighting=none +resharper_string_literal_typo_highlighting=none +resharper_string_literal_wrong_quotes_highlighting=none +resharper_super_call_prohibits_this_highlighting=none +resharper_suspicious_lambda_block_highlighting=none +resharper_syntax_is_not_allowed_highlighting=none +resharper_this_in_global_context_highlighting=none +resharper_throw_must_be_followed_by_expression_highlighting=none +resharper_undeclared_global_variable_using_highlighting=none +resharper_unexpected_value_highlighting=none +resharper_unknown_css_class_highlighting=none +resharper_unknown_css_variable_highlighting=none +resharper_unknown_css_vendor_extension_highlighting=none +resharper_unsafe_comma_in_object_properties_list_highlighting=none +resharper_unused_auto_property_accessor_global_highlighting=none +resharper_unused_inherited_parameter_highlighting=none +resharper_unused_locals_highlighting=none +resharper_unused_member_global_highlighting=none +resharper_unused_member_in_super_global_highlighting=none +resharper_unused_method_return_value_global_highlighting=none +resharper_unused_parameter_highlighting=none +resharper_unused_property_highlighting=none +resharper_usage_of_definitely_unassigned_value_highlighting=none +resharper_usage_of_possibly_unassigned_value_highlighting=none +resharper_use_of_implicit_global_in_function_scope_highlighting=none +resharper_using_of_reserved_word_error_highlighting=none +resharper_using_of_reserved_word_highlighting=none +resharper_value_should_have_units_highlighting=none +resharper_variable_can_be_made_const_highlighting=none +resharper_variable_can_be_made_let_highlighting=none +resharper_variable_can_be_moved_to_inner_block_highlighting=none +resharper_variable_used_before_declared_highlighting=none +resharper_variable_used_in_inner_scope_before_declared_highlighting=none +resharper_variable_used_out_of_scope_highlighting=none +resharper_with_statement_using_error_highlighting=none +resharper_wrong_expression_statement_highlighting=none +resharper_xml_doc_comment_syntax_problem_highlighting=none diff --git a/src/Flurl.Http.Xml/Flurl.Http.Xml.csproj b/src/Flurl.Http.Xml/Flurl.Http.Xml.csproj index 312e786..a57ecc7 100644 --- a/src/Flurl.Http.Xml/Flurl.Http.Xml.csproj +++ b/src/Flurl.Http.Xml/Flurl.Http.Xml.csproj @@ -17,6 +17,7 @@ true git https://github.com/lvermeulen/Flurl.Http.Xml + true diff --git a/src/Flurl.Http.Xml/FlurlRequestExtensions.cs b/src/Flurl.Http.Xml/FlurlRequestExtensions.cs index 88ae7c5..a278a0c 100644 --- a/src/Flurl.Http.Xml/FlurlRequestExtensions.cs +++ b/src/Flurl.Http.Xml/FlurlRequestExtensions.cs @@ -25,7 +25,7 @@ public static class FlurlRequestExtensions /// A Task whose result is the XML response body deserialized to an object of type T. /// public static Task GetXmlAsync(this IFlurlRequest request, - CancellationToken cancellationToken = default(CancellationToken), HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) + CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) { return request.SendAsync(HttpMethod.Get, null, cancellationToken, completionOption).ReceiveXml(); } @@ -40,7 +40,7 @@ public static Task GetXmlAsync(this IFlurlRequest request, /// A Task whose result is the XML response body parsed into an XDocument. /// public static Task GetXDocumentAsync(this IFlurlRequest request, - CancellationToken cancellationToken = default(CancellationToken), HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) + CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) { return request.SendAsync(HttpMethod.Get, null, cancellationToken, completionOption).ReceiveXDocument(); } @@ -56,7 +56,7 @@ public static Task GetXDocumentAsync(this IFlurlRequest request, /// A Task whose result is the XML response body parsed into a collection of XElements. /// public static Task> GetXElementsFromXPath(this IFlurlRequest request, string expression, - CancellationToken cancellationToken = default(CancellationToken), HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) + CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) { return request.SendAsync(HttpMethod.Get, null, cancellationToken, completionOption).ReceiveXElementsFromXPath(expression); } @@ -73,7 +73,7 @@ public static Task> GetXElementsFromXPath(this IFlurlReque /// A Task whose result is the XML response body parsed into a collection of XElements. /// public static Task> GetXElementsFromXPath(this IFlurlRequest request, string expression, IXmlNamespaceResolver resolver, - CancellationToken cancellationToken = default(CancellationToken), HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) + CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) { return request.SendAsync(HttpMethod.Get, null, cancellationToken, completionOption).ReceiveXElementsFromXPath(expression, resolver); } @@ -113,7 +113,7 @@ private static string GetMediaType(this IHttpSettingsContainer request) /// A Task whose result is the received HttpResponseMessage. /// public static async Task SendXmlAsync(this IFlurlRequest request, HttpMethod httpMethod, object data, - CancellationToken cancellationToken = default(CancellationToken), HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) + CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) { var content = new CapturedXmlContent(request.Settings.XmlSerializer().Serialize(data), request.GetMediaType()); return await request.SendAsync(httpMethod, content, cancellationToken, completionOption); @@ -130,7 +130,7 @@ public static async Task SendXmlAsync(this IFlurlRequest re /// A Task whose result is the received HttpResponseMessage. /// public static Task PostXmlAsync(this IFlurlRequest request, object data, - CancellationToken cancellationToken = default(CancellationToken), HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => + CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => SendXmlAsync(request, HttpMethod.Post, data, cancellationToken, completionOption); /// @@ -144,7 +144,7 @@ public static Task PostXmlAsync(this IFlurlRequest request, /// A Task whose result is the received HttpResponseMessage. /// public static Task PutXmlAsync(this IFlurlRequest request, object data, - CancellationToken cancellationToken = default(CancellationToken), HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => + CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => SendXmlAsync(request, HttpMethod.Put, data, cancellationToken, completionOption); } } diff --git a/src/Flurl.Http.Xml/MicrosoftXmlSerializer.cs b/src/Flurl.Http.Xml/MicrosoftXmlSerializer.cs index f24c9e7..18f7605 100644 --- a/src/Flurl.Http.Xml/MicrosoftXmlSerializer.cs +++ b/src/Flurl.Http.Xml/MicrosoftXmlSerializer.cs @@ -75,13 +75,13 @@ private static T DeserializeInternal(TextReader reader) /// /// /// The string. - public T Deserialize(string s) => string.IsNullOrWhiteSpace(s) ? default(T) : DeserializeInternal(new StringReader(s)); + public T Deserialize(string s) => string.IsNullOrWhiteSpace(s) ? default : DeserializeInternal(new StringReader(s)); /// /// Deserializes an object from a stream representation. /// /// /// The stream. - public T Deserialize(Stream stream) => stream == null ? default(T) : DeserializeInternal(new StreamReader(stream)); + public T Deserialize(Stream stream) => stream == null ? default : DeserializeInternal(new StreamReader(stream)); } } \ No newline at end of file diff --git a/src/Flurl.Http.Xml/StringExtensions.cs b/src/Flurl.Http.Xml/StringExtensions.cs index a448ad7..62f6914 100644 --- a/src/Flurl.Http.Xml/StringExtensions.cs +++ b/src/Flurl.Http.Xml/StringExtensions.cs @@ -23,7 +23,7 @@ public static class StringExtensions /// A Task whose result is the XML response body deserialized to an object of type T. /// public static Task GetXmlAsync(this string url, - CancellationToken cancellationToken = default(CancellationToken), HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => + CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => new FlurlRequest(url).GetXmlAsync(cancellationToken, completionOption); /// @@ -34,7 +34,7 @@ public static Task GetXmlAsync(this string url, /// The HttpCompletionOption used in the request. Optional. /// A Task whose result is the XML response body parsed into an XDocument. public static Task GetXDocumentAsync(this string url, - CancellationToken cancellationToken = default(CancellationToken), HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => + CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => new FlurlRequest(url).GetXDocumentAsync(cancellationToken, completionOption); /// @@ -46,7 +46,7 @@ public static Task GetXDocumentAsync(this string url, /// The HttpCompletionOption used in the request. Optional. /// A Task whose result is the XML response body parsed into a collection of XElements. public static Task> GetXElementsFromXPath(this string url, string expression, - CancellationToken cancellationToken = default(CancellationToken), HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => + CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => new FlurlRequest(url).GetXElementsFromXPath(expression, cancellationToken, completionOption); /// @@ -59,7 +59,7 @@ public static Task> GetXElementsFromXPath(this string url, /// The HttpCompletionOption used in the request. Optional. /// A Task whose result is the XML response body parsed into a collection of XElements. public static Task> GetXElementsFromXPath(this string url, string expression, IXmlNamespaceResolver resolver, - CancellationToken cancellationToken = default(CancellationToken), HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => + CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => new FlurlRequest(url).GetXElementsFromXPath(expression, resolver, cancellationToken, completionOption); /// @@ -72,7 +72,7 @@ public static Task> GetXElementsFromXPath(this string url, /// The HttpCompletionOption used in the request. Optional. /// A Task whose result is the received HttpResponseMessage. public static Task SendXmlAsync(this string url, HttpMethod method, object data, - CancellationToken cancellationToken = default(CancellationToken), HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => + CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => new FlurlRequest(url).SendXmlAsync(method, data, cancellationToken, completionOption); /// @@ -84,7 +84,7 @@ public static Task SendXmlAsync(this string url, HttpMethod /// The HttpCompletionOption used in the request. Optional. /// A Task whose result is the received HttpResponseMessage. public static Task PostXmlAsync(this string url, object data, - CancellationToken cancellationToken = default(CancellationToken), HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => + CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => new FlurlRequest(url).PostXmlAsync(data, cancellationToken, completionOption); /// @@ -96,7 +96,7 @@ public static Task PostXmlAsync(this string url, object dat /// The HttpCompletionOption used in the request. Optional. /// A Task whose result is the received HttpResponseMessage. public static Task PutXmlAsync(this string url, object data, - CancellationToken cancellationToken = default(CancellationToken), HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => + CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => new FlurlRequest(url).PutXmlAsync(data, cancellationToken, completionOption); } } \ No newline at end of file diff --git a/src/Flurl.Http.Xml/UrlExtensions.cs b/src/Flurl.Http.Xml/UrlExtensions.cs index 11c2aa8..ad3b8e3 100644 --- a/src/Flurl.Http.Xml/UrlExtensions.cs +++ b/src/Flurl.Http.Xml/UrlExtensions.cs @@ -23,7 +23,7 @@ public static class UrlExtensions /// A Task whose result is the XML response body deserialized to an object of type T. /// public static Task GetXmlAsync(this Url url, - CancellationToken cancellationToken = default(CancellationToken), HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => + CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => new FlurlRequest(url).GetXmlAsync(cancellationToken, completionOption); /// @@ -34,7 +34,7 @@ public static Task GetXmlAsync(this Url url, /// The HttpCompletionOption used in the request. Optional. /// A Task whose result is the XML response body parsed into an XDocument. public static Task GetXDocumentAsync(this Url url, - CancellationToken cancellationToken = default(CancellationToken), HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => + CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => new FlurlRequest(url).GetXDocumentAsync(cancellationToken, completionOption); /// @@ -46,7 +46,7 @@ public static Task GetXDocumentAsync(this Url url, /// The HttpCompletionOption used in the request. Optional. /// A Task whose result is the XML response body parsed into a collection of XElements. public static Task> GetXElementsFromXPath(this Url url, string expression, - CancellationToken cancellationToken = default(CancellationToken), HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => + CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => new FlurlRequest(url).GetXElementsFromXPath(expression, cancellationToken, completionOption); /// @@ -59,7 +59,7 @@ public static Task> GetXElementsFromXPath(this Url url, st /// The HttpCompletionOption used in the request. Optional. /// A Task whose result is the XML response body parsed into a collection of XElements. public static Task> GetXElementsFromXPath(this Url url, string expression, IXmlNamespaceResolver resolver, - CancellationToken cancellationToken = default(CancellationToken), HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => + CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => new FlurlRequest(url).GetXElementsFromXPath(expression, resolver, cancellationToken, completionOption); /// @@ -72,7 +72,7 @@ public static Task> GetXElementsFromXPath(this Url url, st /// The HttpCompletionOption used in the request. Optional. /// A Task whose result is the received HttpResponseMessage. public static Task SendXmlAsync(this Url url, HttpMethod method, object data, - CancellationToken cancellationToken = default(CancellationToken), HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => + CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => new FlurlRequest(url).SendXmlAsync(method, data, cancellationToken, completionOption); /// @@ -84,7 +84,7 @@ public static Task SendXmlAsync(this Url url, HttpMethod me /// The HttpCompletionOption used in the request. Optional. /// A Task whose result is the received HttpResponseMessage. public static Task PostXmlAsync(this Url url, object data, - CancellationToken cancellationToken = default(CancellationToken), HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => + CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => new FlurlRequest(url).PostXmlAsync(data, cancellationToken, completionOption); /// @@ -96,7 +96,7 @@ public static Task PostXmlAsync(this Url url, object data, /// The HttpCompletionOption used in the request. Optional. /// A Task whose result is the received HttpResponseMessage. public static Task PutXmlAsync(this Url url, object data, - CancellationToken cancellationToken = default(CancellationToken), HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => + CancellationToken cancellationToken = default, HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead) => new FlurlRequest(url).PutXmlAsync(data, cancellationToken, completionOption); } } \ No newline at end of file diff --git a/test/Flurl.Http.Xml.Tests/Flurl.Http.Xml.Tests.csproj b/test/Flurl.Http.Xml.Tests/Flurl.Http.Xml.Tests.csproj index 846c8d1..de0c493 100644 --- a/test/Flurl.Http.Xml.Tests/Flurl.Http.Xml.Tests.csproj +++ b/test/Flurl.Http.Xml.Tests/Flurl.Http.Xml.Tests.csproj @@ -1,11 +1,10 @@  - netcoreapp1.0 + netcoreapp2.2 Flurl.Http.Xml.Tests Flurl.Http.Xml.Tests true - 1.0.4 @@ -27,7 +26,7 @@ - + Always diff --git a/test/Flurl.Http.Xml.Tests/Flurl.Http.Xml.Tests.xunit.runner.json b/test/Flurl.Http.Xml.Tests/Flurl.Http.Xml.Tests.xunit.runner.json new file mode 100644 index 0000000..dd80f43 --- /dev/null +++ b/test/Flurl.Http.Xml.Tests/Flurl.Http.Xml.Tests.xunit.runner.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", + "parallelizeAssembly": false, + "parallelizeTestCollections": false +} diff --git a/test/Flurl.Http.Xml.Tests/xunit.runner.json b/test/Flurl.Http.Xml.Tests/xunit.runner.json deleted file mode 100644 index c0d0ff0..0000000 --- a/test/Flurl.Http.Xml.Tests/xunit.runner.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parallelizeTestCollections": false -}