From 767989815919e004e28578418d40e0f51dfb42b9 Mon Sep 17 00:00:00 2001 From: jvelilla Date: Tue, 14 May 2013 09:29:50 -0300 Subject: [PATCH] Move expectation classed under a expectation cluster, added a new expectation class for header. --- .../http_client_header_expectation.e | 51 +++++++++++++++++++ .../http_client_response_body_expectation.e | 0 .../http_client_response_expectation.e | 0 ..._client_response_status_code_expectation.e | 0 4 files changed, 51 insertions(+) create mode 100644 library/network/http_client/src/expectation/http_client_header_expectation.e rename library/network/http_client/src/{ => expectation}/http_client_response_body_expectation.e (100%) rename library/network/http_client/src/{ => expectation}/http_client_response_expectation.e (100%) rename library/network/http_client/src/{ => expectation}/http_client_response_status_code_expectation.e (100%) diff --git a/library/network/http_client/src/expectation/http_client_header_expectation.e b/library/network/http_client/src/expectation/http_client_header_expectation.e new file mode 100644 index 00000000..2d0eb5c0 --- /dev/null +++ b/library/network/http_client/src/expectation/http_client_header_expectation.e @@ -0,0 +1,51 @@ +note + description: "Summary description for {HTTP_CLIENT_HEADER_EXPECTATION}." + author: "" + date: "$Date$" + revision: "$Revision$" + +class + HTTP_CLIENT_HEADER_EXPECTATION +inherit + HTTP_CLIENT_RESPONSE_EXPECTATION +create + make + +feature {NONE} -- Initializtion + make (a_header: STRING_32; a_value : STRING) + -- Create and Initialize a header expectation + do + header := a_header + value := a_value + ensure + header_set : header ~ a_header + value_set : value ~ a_value + end + +feature -- Result expected + expected (resp: HTTP_CLIENT_RESPONSE): BOOLEAN + -- is `header name and value expected' equals to resp.header(name)? + do + if attached {READABLE_STRING_8} resp.header (header) as l_value then + if l_value.same_string (l_value) then + Result := true + end + end + end + +feature -- Access + header : STRING + -- header name + value : STRING + -- header value +;note + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" + source: "[ + Eiffel Software + 5949 Hollister Ave., Goleta, CA 93117 USA + Telephone 805-685-1006, Fax 805-685-6869 + Website http://www.eiffel.com + Customer support http://support.eiffel.com + ]" +end diff --git a/library/network/http_client/src/http_client_response_body_expectation.e b/library/network/http_client/src/expectation/http_client_response_body_expectation.e similarity index 100% rename from library/network/http_client/src/http_client_response_body_expectation.e rename to library/network/http_client/src/expectation/http_client_response_body_expectation.e diff --git a/library/network/http_client/src/http_client_response_expectation.e b/library/network/http_client/src/expectation/http_client_response_expectation.e similarity index 100% rename from library/network/http_client/src/http_client_response_expectation.e rename to library/network/http_client/src/expectation/http_client_response_expectation.e diff --git a/library/network/http_client/src/http_client_response_status_code_expectation.e b/library/network/http_client/src/expectation/http_client_response_status_code_expectation.e similarity index 100% rename from library/network/http_client/src/http_client_response_status_code_expectation.e rename to library/network/http_client/src/expectation/http_client_response_status_code_expectation.e