<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="cutter-Assertions-for-HTTP-client-and-server">
<refmeta>
<refentrytitle role="top_of_page" id="cutter-Assertions-for-HTTP-client-and-server.top_of_page">HTTPクライアント・サーバ用の検証</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>Cutterライブラリ</refmiscinfo>
</refmeta>
<refnamediv>
<refname>HTTPクライアント・サーバ用の検証</refname>
<refpurpose>libsoupを使ってあなたのHTTPクライアント・サーバが期待通りに動作しているかを検証します。</refpurpose>
</refnamediv>

<refsect1 id="cutter-Assertions-for-HTTP-client-and-server.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_return" colwidth="150px"/>
<colspec colname="functions_name"/>
<tbody>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="soupcut-message-assert-equal-content-type">soupcut_message_assert_equal_content_type</link> <phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="soupcut-client-assert-equal-content-type">soupcut_client_assert_equal_content_type</link> <phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="soupcut-client-assert-response">soupcut_client_assert_response</link> <phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="soupcut-client-assert-equal-body">soupcut_client_assert_equal_body</link> <phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="soupcut-client-assert-match-body">soupcut_client_assert_match_body</link> <phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>


<refsect1 id="cutter-Assertions-for-HTTP-client-and-server.description" role="desc">
<title role="desc.title">説明</title>

</refsect1>
<refsect1 id="cutter-Assertions-for-HTTP-client-and-server.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="soupcut-message-assert-equal-content-type" role="function" condition="since:1.0.8">
<title>soupcut_message_assert_equal_content_type ()</title>
<indexterm zone="soupcut-message-assert-equal-content-type" role="1.0.8"><primary>soupcut_message_assert_equal_content_type</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
soupcut_message_assert_equal_content_type
                               (<parameter>const <link linkend="gchar"><type>gchar</type></link> *expected</parameter>,
                                <parameter><link linkend="SoupMessage"><type>SoupMessage</type></link> *message</parameter>,
                                <parameter>...</parameter>);</programlisting>
<para>Passes if <parameter>expected</parameter>
 == <parameter>message-&gt;response_headers-&gt;content_type</parameter>
.</para>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>expected</para></entry>
<entry role="parameter_description"><para>期待するContent-Type。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>message</para></entry>
<entry role="parameter_description"><para><link linkend="SoupMessage"><type>SoupMessage</type></link>オブジェクト。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>追加メッセージ（省略可能）。詳細は<link linkend="cut-message"><function>cut_message()</function></link>を見てください。</para></entry>
<entry role="parameter_annotations"/></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-1.0.8">1.0.8</link></para></refsect2>
<refsect2 id="soupcut-client-assert-equal-content-type" role="function" condition="since:1.0.8">
<title>soupcut_client_assert_equal_content_type ()</title>
<indexterm zone="soupcut-client-assert-equal-content-type" role="1.0.8"><primary>soupcut_client_assert_equal_content_type</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
soupcut_client_assert_equal_content_type
                               (<parameter>const <link linkend="gchar"><type>gchar</type></link> *expected</parameter>,
                                <parameter><link linkend="SoupCutClient"><type>SoupCutClient</type></link> *client</parameter>,
                                <parameter>...</parameter>);</programlisting>
<para>Passes if <parameter>expected</parameter>
 equals to Content-Type of the latest
message of <parameter>client</parameter>
.</para>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>expected</para></entry>
<entry role="parameter_description"><para>期待するContent-Type。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>client</para></entry>
<entry role="parameter_description"><para><link linkend="SoupCutClient"><type>SoupCutClient</type></link>オブジェクト。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>追加メッセージ（省略可能）。詳細は<link linkend="cut-message"><function>cut_message()</function></link>を見てください。</para></entry>
<entry role="parameter_annotations"/></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-1.0.8">1.0.8</link></para></refsect2>
<refsect2 id="soupcut-client-assert-response" role="function" condition="since:1.0.8">
<title>soupcut_client_assert_response ()</title>
<indexterm zone="soupcut-client-assert-response" role="1.0.8"><primary>soupcut_client_assert_response</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
soupcut_client_assert_response (<parameter><link linkend="SoupCutClient"><type>SoupCutClient</type></link> *client</parameter>,
                                <parameter>...</parameter>);</programlisting>
<para><parameter>client</parameter>のステータスコードが2XXならパスします。</para>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>client</para></entry>
<entry role="parameter_description"><para><link linkend="SoupCutClient"><type>SoupCutClient</type></link>オブジェクト。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>追加メッセージ（省略可能）。詳細は<link linkend="cut-message"><function>cut_message()</function></link>を見てください。</para></entry>
<entry role="parameter_annotations"/></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-1.0.8">1.0.8</link></para></refsect2>
<refsect2 id="soupcut-client-assert-equal-body" role="function" condition="since:1.0.8">
<title>soupcut_client_assert_equal_body ()</title>
<indexterm zone="soupcut-client-assert-equal-body" role="1.0.8"><primary>soupcut_client_assert_equal_body</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
soupcut_client_assert_equal_body (<parameter>const <link linkend="gchar"><type>gchar</type></link> *expected</parameter>,
                                  <parameter><link linkend="SoupCutClient"><type>SoupCutClient</type></link> *client</parameter>,
                                  <parameter>...</parameter>);</programlisting>
<para>Passes if <parameter>expected</parameter>
 == <parameter>client-&gt;response_body-&gt;data</parameter>
.</para>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>expected</para></entry>
<entry role="parameter_description"><para>期待するレスポンスの本体。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>client</para></entry>
<entry role="parameter_description"><para><link linkend="SoupCutClient"><type>SoupCutClient</type></link>オブジェクト。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>追加メッセージ（省略可能）。詳細は<link linkend="cut-message"><function>cut_message()</function></link>を見てください。</para></entry>
<entry role="parameter_annotations"/></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-1.0.8">1.0.8</link></para></refsect2>
<refsect2 id="soupcut-client-assert-match-body" role="function" condition="since:1.0.8">
<title>soupcut_client_assert_match_body ()</title>
<indexterm zone="soupcut-client-assert-match-body" role="1.0.8"><primary>soupcut_client_assert_match_body</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
soupcut_client_assert_match_body (<parameter>const <link linkend="gchar"><type>gchar</type></link> *pattern</parameter>,
                                  <parameter><link linkend="SoupCutClient"><type>SoupCutClient</type></link> *client</parameter>,
                                  <parameter>...</parameter>);</programlisting>
<para>Passes if <parameter>pattern</parameter>
 matches the response body of
the latest message of <parameter>client</parameter>
.</para>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>pattern</para></entry>
<entry role="parameter_description"><para>正規表現。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>client</para></entry>
<entry role="parameter_description"><para><link linkend="SoupCutClient"><type>SoupCutClient</type></link>オブジェクト。</para></entry>
<entry role="parameter_annotations"/></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>追加メッセージ（省略可能）。詳細は<link linkend="cut-message"><function>cut_message()</function></link>を見てください。</para></entry>
<entry role="parameter_annotations"/></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-1.0.8">1.0.8</link></para></refsect2>

</refsect1>
<refsect1 id="cutter-Assertions-for-HTTP-client-and-server.other_details" role="details">
<title role="details.title">Types and Values</title>

</refsect1>

</refentry>
