<?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>

<refsynopsisdiv id="cutter-Assertions-for-HTTP-client-and-server.synopsis" role="synopsis">
<title role="synopsis.title">概要</title>

<synopsis><link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="soupcut-client-assert-equal-body">soupcut_client_assert_equal_body</link>    (<parameter>const <link linkend="gchar"><type>gchar</type></link> *expected</parameter>,
                                                         <parameter><link linkend="SoupCutClient"><type>SoupCutClient</type></link> *client</parameter>,
                                                         <parameter>...</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="soupcut-client-assert-equal-content-type">soupcut_client_assert_equal_content_type</link>
                                                        (<parameter>const <link linkend="gchar"><type>gchar</type></link> *expected</parameter>,
                                                         <parameter><link linkend="SoupCutClient"><type>SoupCutClient</type></link> *client</parameter>,
                                                         <parameter>...</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="soupcut-client-assert-match-body">soupcut_client_assert_match_body</link>    (<parameter>const <link linkend="gchar"><type>gchar</type></link> *pattern</parameter>,
                                                         <parameter><link linkend="SoupCutClient"><type>SoupCutClient</type></link> *client</parameter>,
                                                         <parameter>...</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="soupcut-client-assert-response">soupcut_client_assert_response</link>      (<parameter><link linkend="SoupCutClient"><type>SoupCutClient</type></link> *client</parameter>,
                                                         <parameter>...</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="soupcut-message-assert-equal-content-type">soupcut_message_assert_equal_content_type</link>
                                                        (<parameter>const <link linkend="gchar"><type>gchar</type></link> *expected</parameter>,
                                                         <parameter><link linkend="SoupMessage"><type>SoupMessage</type></link> *message</parameter>,
                                                         <parameter>...</parameter>);
</synopsis>
</refsynopsisdiv>

<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.details" role="details">
<title role="details.title">詳細</title>
<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><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><parameter>expected</parameter> == <parameter>message-&gt;response_body-&gt;data</parameter>が成り立つときパスします。</para><variablelist role="params">
<varlistentry><term><parameter>expected</parameter> :</term>
<listitem><simpara>期待するレスポンスの本体。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>client</parameter> :</term>
<listitem><simpara><link linkend="SoupCutClient"><type>SoupCutClient</type></link>オブジェクト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter> :</term>
<listitem><simpara>追加メッセージ（省略可能）。詳細は<link linkend="cut-message"><function>cut_message()</function></link>を見てください。</simpara></listitem></varlistentry>
</variablelist><para role="since">1.0.8から</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><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><parameter>expected</parameter>が<parameter>client</parameter>の最後のメッセージのContent-Typeと等しいとパスします。</para><variablelist role="params">
<varlistentry><term><parameter>expected</parameter> :</term>
<listitem><simpara>期待するContent-Type。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>client</parameter> :</term>
<listitem><simpara><link linkend="SoupCutClient"><type>SoupCutClient</type></link>オブジェクト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter> :</term>
<listitem><simpara>追加メッセージ（省略可能）。詳細は<link linkend="cut-message"><function>cut_message()</function></link>を見てください。</simpara></listitem></varlistentry>
</variablelist><para role="since">1.0.8から</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><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><parameter>pattern</parameter>が<parameter>client</parameter>の最後のメッセージのレスポンスの本体にマッチしたときにパスします。</para><variablelist role="params">
<varlistentry><term><parameter>pattern</parameter> :</term>
<listitem><simpara>正規表現。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>client</parameter> :</term>
<listitem><simpara><link linkend="SoupCutClient"><type>SoupCutClient</type></link>オブジェクト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter> :</term>
<listitem><simpara>追加メッセージ（省略可能）。詳細は<link linkend="cut-message"><function>cut_message()</function></link>を見てください。</simpara></listitem></varlistentry>
</variablelist><para role="since">1.0.8から</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><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><variablelist role="params">
<varlistentry><term><parameter>client</parameter> :</term>
<listitem><simpara><link linkend="SoupCutClient"><type>SoupCutClient</type></link>オブジェクト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter> :</term>
<listitem><simpara>追加メッセージ（省略可能）。詳細は<link linkend="cut-message"><function>cut_message()</function></link>を見てください。</simpara></listitem></varlistentry>
</variablelist><para role="since">1.0.8から</para></refsect2>
<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><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><parameter>expected</parameter> == <parameter>message-&gt;response_headers-&gt;content_type</parameter>が成り立つときパスします。</para><variablelist role="params">
<varlistentry><term><parameter>expected</parameter> :</term>
<listitem><simpara>期待するContent-Type。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>message</parameter> :</term>
<listitem><simpara><link linkend="SoupMessage"><type>SoupMessage</type></link>オブジェクト。</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter> :</term>
<listitem><simpara>追加メッセージ（省略可能）。詳細は<link linkend="cut-message"><function>cut_message()</function></link>を見てください。</simpara></listitem></varlistentry>
</variablelist><para role="since">1.0.8から</para></refsect2>

</refsect1>

</refentry>
