Index: /branches/version-2_13-dev/tests/class/SC_CartSession/SC_CartSession_TestBase.php
===================================================================
--- /branches/version-2_13-dev/tests/class/SC_CartSession/SC_CartSession_TestBase.php	(revision 23398)
+++ /branches/version-2_13-dev/tests/class/SC_CartSession/SC_CartSession_TestBase.php	(revision 23399)
@@ -64,23 +64,4 @@
         $this->objQuery->delete('dtb_products_class');
         foreach ($product_class as $key => $item) {
-            $this->objQuery->insert('dtb_products_class', $item);
-        }
-
-        // 1000商品一気に投入
-        for ($i = 3000; $i < 3100; $i++) {
-            $item = array(
-                'update_date' => 'CURRENT_TIMESTAMP',
-                'product_class_id' => $i,
-                'product_id' => $i,
-                'product_type_id' => '1',
-                'product_code' => 'code'.$i,
-                'classcategory_id1' => '1001',
-                'classcategory_id2' => '1002',
-                'price01' => $i,
-                'price02' => $i,
-                'stock' => '99',
-                'creator_id' => '1',
-                'del_flg' => '0'
-            );
             $this->objQuery->insert('dtb_products_class', $item);
         }
@@ -177,7 +158,72 @@
             $this->objQuery->insert('dtb_products', $item);
         }
-
-        // 100商品一気に投入
-        for ($i = 3000; $i < 4000; $i++) {
+    }
+
+    /**
+     * DBに商品ステータス情報を登録します.
+     */
+    protected function setUpProductStatus()
+    {
+        $class_category = array(
+            array(
+                'update_date' => 'CURRENT_TIMESTAMP',
+                'product_status_id' => '1',
+                'product_id' => '1001',
+                'creator_id' => '1',
+                'del_flg' => '0'
+            ),
+            array(
+                'update_date' => 'CURRENT_TIMESTAMP',
+                'product_status_id' => '1',
+                'product_id' => '1002',
+                'creator_id' => '1',
+                'del_flg' => '0'
+            )
+        );
+
+        $this->objQuery->delete('dtb_product_status');
+        foreach ($class_category as $key => $item) {
+            $this->objQuery->insert('dtb_product_status', $item);
+        }
+    }
+
+
+    /**
+     * DBに商品クラス情報を大量に設定します.
+     */
+    protected function setUpBigProductClass()
+    {
+        $this->objQuery->delete('dtb_products_class');
+        // 商品を一気に投入
+        for ($i = 3000; $i < 3030; $i++) {
+            $item = array(
+                'update_date' => 'CURRENT_TIMESTAMP',
+                'product_class_id' => $i,
+                'product_id' => $i,
+                'product_type_id' => $i%3+1,
+                'product_code' => 'code'.$i,
+                'classcategory_id1' => '1001',
+                'classcategory_id2' => '1002',
+                'price01' => $i,
+                'price02' => $i,
+                'stock' => '99',
+                'creator_id' => '1',
+                'del_flg' => '0'
+            );
+            $this->objQuery->insert('dtb_products_class', $item);
+        }
+
+        $this->setUpClassCategory();
+        $this->setUpBigProducts();
+    }
+
+    /**
+     * DBに製品情報を大量に登録します.
+     */
+    protected function setUpBigProducts()
+    {
+        $this->objQuery->delete('dtb_products');
+        // 商品一気に投入
+        for ($i = 3000; $i < 3030; $i++) {
             $item = array(
                 'update_date' => 'CURRENT_TIMESTAMP',
@@ -199,89 +245,3 @@
         }
     }
-
-    /**
-     * DBに商品ステータス情報を登録します.
-     */
-    protected function setUpProductStatus()
-    {
-        $class_category = array(
-            array(
-                'update_date' => 'CURRENT_TIMESTAMP',
-                'product_status_id' => '1',
-                'product_id' => '1001',
-                'creator_id' => '1',
-                'del_flg' => '0'
-            ),
-            array(
-                'update_date' => 'CURRENT_TIMESTAMP',
-                'product_status_id' => '1',
-                'product_id' => '1002',
-                'creator_id' => '1',
-                'del_flg' => '0'
-            )
-        );
-
-        $this->objQuery->delete('dtb_product_status');
-        foreach ($class_category as $key => $item) {
-            $this->objQuery->insert('dtb_product_status', $item);
-        }
-    }
-
-
-    /**
-     * DBに商品クラス情報を大量に設定します.
-     */
-    protected function setUpBigProductClass()
-    {
-        $this->objQuery->delete('dtb_products_class');
-        // 商品を一気に投入
-        for ($i = 3000; $i < 3030; $i++) {
-            $item = array(
-                'update_date' => 'CURRENT_TIMESTAMP',
-                'product_class_id' => $i,
-                'product_id' => $i,
-                'product_type_id' => $i%3+1,
-                'product_code' => 'code'.$i,
-                'classcategory_id1' => '1001',
-                'classcategory_id2' => '1002',
-                'price01' => $i,
-                'price02' => $i,
-                'stock' => '99',
-                'creator_id' => '1',
-                'del_flg' => '0'
-            );
-            $this->objQuery->insert('dtb_products_class', $item);
-        }
-
-        $this->setUpClassCategory();
-        $this->setUpBigProducts();
-    }
-
-    /**
-     * DBに製品情報を大量に登録します.
-     */
-    protected function setUpBigProducts()
-    {
-        $this->objQuery->delete('dtb_products');
-        // 商品一気に投入
-        for ($i = 3000; $i < 3030; $i++) {
-            $item = array(
-                'update_date' => 'CURRENT_TIMESTAMP',
-                'product_id' => $i,
-                'name' => '製品名'.$i,
-                'comment1' => 'コメント'.$i,
-                'comment2' => 'コメント'.$i,
-                'comment3' => 'コメント'.$i,
-                'main_list_comment' => 'リストコメント'.$i,
-                'main_comment' => 'メインコメント'.$i,
-                'main_image' => $i.'.jpg',
-                'main_list_image' => $i.'-main.jpg',
-                'deliv_date_id' => '1',
-                'del_flg' => '0',
-                'creator_id' => '1',
-                'status' => '1'
-            );
-            $this->objQuery->insert('dtb_products', $item);
-        }
-    }
 }
Index: /branches/version-2_13-dev/tests/class/SC_CartSession/SC_CartSession_getAllCartList.php
===================================================================
--- /branches/version-2_13-dev/tests/class/SC_CartSession/SC_CartSession_getAllCartList.php	(revision 23399)
+++ /branches/version-2_13-dev/tests/class/SC_CartSession/SC_CartSession_getAllCartList.php	(revision 23399)
@@ -0,0 +1,95 @@
+<?php
+
+$HOME = realpath(dirname(__FILE__)) . "/../../..";
+require_once($HOME . "/tests/class/SC_CartSession/SC_CartSession_TestBase.php");
+
+/**
+ * SC_CartSession_getAllCartList
+ *
+ * @package
+ * @version $id$
+ * @copyright
+ * @author Nobuhiko Kimoto <info@nob-log.info>
+ * @license
+ */
+class SC_CartSession_getAllCartList extends SC_CartSession_TestBase
+{
+
+    protected function setUp()
+    {
+        parent::setUp();
+        $this->objCartSession = new SC_CartSession_Ex();
+    }
+
+    protected function tearDown()
+    {
+        parent::tearDown();
+    }
+
+    /////////////////////////////////////////
+
+    /**
+     * @test
+     */
+    public function getAllCartList_商品を追加していなければ空の配列を返す()
+    {
+        $this->setUpProductClass();
+        $this->expected = 0;
+        $this->actual = count($this->objCartSession->getAllCartList());
+
+        $this->verify('商品数');
+    }
+
+    /**
+     * @test
+     */
+    public function getAllCartList_商品を1つ追加した場合1つの配列を返す()
+    {
+        $this->setUpProductClass();
+        $this->expected = 1;
+        $this->objCartSession->addProduct('1001', 1);
+
+        $cartList = $this->objCartSession->getAllCartList();
+        $this->actual = count($cartList);
+
+        $this->verify('カート数');
+
+        return $cartList;
+    }
+
+    /**
+     * @test
+     */
+    public function getAllCartList_違う商品種別の商品を追加した場合用品種別分の配列を返す()
+    {
+        $this->setUpProductClass();
+        $this->expected = 2;
+        $this->objCartSession->addProduct('1001', 1);
+        $this->objCartSession->addProduct('1002', 1);
+
+        $cartList = $this->objCartSession->getAllCartList();
+        $this->actual = count($cartList);
+
+        $this->verify('カート数');
+
+        return $cartList;
+    }
+
+    /**
+     * @test
+     */
+    public function getAllCartList_複数回呼んでも同じ内容が返される()
+    {
+        $this->setUpProductClass();
+        $this->objCartSession->addProduct('1001', 1);
+        $this->objCartSession->addProduct('1002', 1);
+
+        $this->expected = $this->objCartSession->getAllCartList();
+        $this->actual = $this->objCartSession->getAllCartList();
+
+        $this->verify('カートの内容');
+
+        return $cartList;
+    }
+
+}
