using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

using BookShopOnline.Model;
using BookShopOnline.WebConfig;
using BookShopOnline.SQLServerDal;
using NUnit.Framework;

namespace BookShopOnline.TestClass
{
    [TestFixture]
    public class TestBookDal
    {
        [Test]
        public void TestSelectBookByBookTypeID1()
        {
            BookDal bookDal = new BookDal();
            DataSet ds = bookDal.SelectBookByBookTypeID(9);

            Assert.IsTrue(ds.Tables[0].Rows.Count>0);
        }

        [Test]
        public void TestSelectBookByBookTypeID2()
        {
            BookDal bookDal = new BookDal();
            DataSet ds = bookDal.SelectBookByBookTypeID(0);

            Assert.IsTrue(ds.Tables[0].Rows.Count==0);
        }

        [Test]
        public void TestSelectBookByBookTypeIDList()
        {
            BookDal bookDal = new BookDal();
            DataSet ds = bookDal.SelectBookByBookTypeIDList(5);

            Assert.IsTrue(ds.Tables[0].Rows.Count > 0);
        }

        [Test]
        public void TestSelectBookByBookID()
        {
            BookDal bookDal = new BookDal();
            DataSet ds = bookDal.SelectBookByBookID(2);

            Assert.IsTrue(ds.Tables[0].Rows.Count==1);
        }
    }
}
