Ejemplo n.º 1
0
        public void ReturnVIdErrTest()
        {
            Model.Book book = new Model.Book();
            Model.Viewer viewer = new Model.Viewer();
            Model.Manager manager = new Model.Manager();
            book.Id = "book";
            viewer.Id = "s00001";//学号错误
            manager.Id = "manager";

            bool expected = false;    //期望值
            bool actual;

            SQLDAL.Book target = new SQLDAL.Book();
            actual = target.ReturnBook(viewer, book, manager); //实际值
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 2
0
        public void ReturnBIdErrTest()
        {
            string b_id = "9787550264";
            string r_id = "s001";
            Model.Viewer v = new Model.Viewer();
            v.Id = r_id;
            Model.Book b = new Model.Book();
            b.Id = b_id;
            Model.Manager m = new Model.Manager();
            //m.Id = m_id;
            //Model.Book book = new Model.Book();
            //Model.Viewer viewer = new Model.Viewer();
            Model.Manager manager = new Model.Manager();
            //book.Id = "boo";//书号错误
            //viewer.Id = "st";
            manager.Id = "manager";

            bool expected = false;    //期望值
            bool actual;

            SQLDAL.Book target = new SQLDAL.Book();
            actual = target.ReturnBook(v, b, manager); //实际值
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        public void ReturnTest()
        {
            Model.Book book = new Model.Book();
            Model.Viewer viewer = new Model.Viewer();
            Model.Manager manager = new Model.Manager();
            book.Id = "9787569902921";
            viewer.Id = "s001";
            manager.Id = "manager";

            bool expected = false;    //期望值//因为数据库中已经存在这一项数据 所以为false
            bool actual;

            SQLDAL.Book target = new SQLDAL.Book();
            actual = target.ReturnBook(viewer, book, manager); //实际值
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 4
0
        public void MulReturnTest()
        {
            Model.Book book = new Model.Book();
            Model.Viewer viewer = new Model.Viewer();
            Model.Manager manager = new Model.Manager();
            book.Id = "9787513318525";
            viewer.Id = "st";
            manager.Id = "manager";

            bool expected = false;    //期望值
            bool actual;

            SQLDAL.Book target = new SQLDAL.Book();
            target.ReturnBook(viewer, book, manager); //第一次还
            actual = target.ReturnBook(viewer, book, manager); //实际值//第二次还
            Assert.AreEqual(expected, actual);
        }