//test update public void TestNhanVien_Update() { _nvxl = new NhanVienXuLy(); bool actual; try { NhanVien nv = new NhanVien(); nv.MaNv = "NV9"; nv.TenNv = "Test"; nv.Luong = 1; nv.NgaySinh = DateTime.Now; nv.GioiTinh = "Test"; nv.DiaChi = "Test"; nv.DienThoai = "123456789"; nv.ChucVu = "Test"; nv.LuongCoBan = 2; nv.NgayVaoLam = DateTime.Now; _nvxl.NhanVien_Update(nv); actual = true; } catch (Exception) { actual = false; } Assert.AreEqual(true, actual); }
//test select public void TestNhanVien_SelectAll() { _nvxl = new NhanVienXuLy(); DataTable dt = _nvxl.NhanVien_SelectAll(); int actual = 0; if (dt.Rows.Count != 0) { actual = 1; } Assert.AreEqual(1, actual); }
//test checkid true public void TestNhanVien_CheckId() { _nvxl = new NhanVienXuLy(); string item = "NV1"; bool check = _nvxl.CheckId(item); int actual = 0; if (check) { actual = 1; } Assert.AreEqual(1, actual); }
//test Find true public void TestNhanVien_FindItem() { _nvxl = new NhanVienXuLy(); string item = "V"; DataTable dt = _nvxl.FindItem(item); int actual = 0; if (dt.Rows.Count != 0) { actual = 1; } Assert.AreEqual(1, actual); }
//test delete public void TestNhanVien_Delete() { _nvxl = new NhanVienXuLy(); bool actual; try { NhanVien nv = new NhanVien(); nv.MaNv = "NV10"; _nvxl.NhanVien_Delete(nv); actual = true; } catch (Exception) { actual = false; } Assert.AreEqual(true, actual); }