Ejemplo n.º 1
0
        //test insert true
        public void TestPhieuXuat_Insert()
        {
            _pxxl = new PhieuXuatXuLy();
            bool actual;

            try
            {
                PhieuXuat px = new PhieuXuat();
                px.MaPhieuXuat = "HD5";
                px.MaNv        = "NV1";
                px.NgayXuat    = DateTime.Now;
                px.MaKh        = "KH1";
                _pxxl.PhieuXuat_Insert(px);
                actual = true;
            }
            catch (Exception)
            {
                actual = false;
            }
            Assert.AreEqual(true, actual);
            PhieuXuat px1 = new PhieuXuat();

            px1.MaPhieuXuat = "HD5";
            _pxxl.PhieuXuat_Delete(px1);
        }
Ejemplo n.º 2
0
        //test select
        public void TestPhieuXuat_SelectAll()
        {
            _pxxl = new PhieuXuatXuLy();
            DataTable dt     = _pxxl.PhieuXuat_SelectAll();
            int       actual = 0;

            if (dt.Rows.Count != 0)
            {
                actual = 1;
            }
            Assert.AreEqual(1, actual);
        }
Ejemplo n.º 3
0
        //test checkid true
        public void TestPhieuXuat_CheckId()
        {
            _pxxl = new PhieuXuatXuLy();
            string item   = "HD1";
            bool   check  = _pxxl.CheckId(item);
            int    actual = 0;

            if (check)
            {
                actual = 1;
            }
            Assert.AreEqual(1, actual);
        }
Ejemplo n.º 4
0
        //test Find true
        public void TestPhieuXuat_FindItem()
        {
            _pxxl = new PhieuXuatXuLy();
            string    item   = "HD";
            DataTable dt     = _pxxl.FindItem(item);
            int       actual = 0;

            if (dt.Rows.Count != 0)
            {
                actual = 1;
            }
            Assert.AreEqual(1, actual);
        }
Ejemplo n.º 5
0
        //test delete
        public void TestPhieuXuat_Delete()
        {
            _pxxl = new PhieuXuatXuLy();
            bool actual;

            try
            {
                PhieuXuat px = new PhieuXuat();
                px.MaPhieuXuat = "HD5";
                _pxxl.PhieuXuat_Delete(px);
                actual = true;
            }
            catch (Exception)
            {
                actual = false;
            }
            Assert.AreEqual(true, actual);
        }