public void TestXoaCoMoiMaHoaDon() { string MaHoaDon = "E72G4TC5"; QuanLyHomestayEntities db = new QuanLyHomestayEntities(); HOADON hd = (from i in db.HOADONs where i.MaHoaDon.Equals(MaHoaDon) select i).FirstOrDefault(); bool expected = true; bool actual = DatPhong.deletePhong(db, hd); Assert.AreEqual(expected, actual); }
public void TestDangKyHotenNull() { QuanLyHomestayEntities db = new QuanLyHomestayEntities(); TAIKHOAN tk = new TAIKHOAN(); tk.HoTen = null; tk.Email = null; tk.Phone = "0956557104"; tk.TaiKhoan1 = "hung11"; tk.Matkhau = "12357809"; bool expected = false; bool actual = Register.addNew(db, tk); Assert.AreEqual(expected, actual); }
public void TestDangKyPhoneNull() { QuanLyHomestayEntities db = new QuanLyHomestayEntities(); TAIKHOAN tk = new TAIKHOAN(); tk.HoTen = "Nguyễn Thị An"; tk.Email = null; tk.Phone = null; tk.TaiKhoan1 = "thian11"; tk.Matkhau = "12385123"; bool expected = false; bool actual = Register.addNew(db, tk); Assert.AreEqual(expected, actual); }
public void TestDangKyKhongEmail() { QuanLyHomestayEntities db = new QuanLyHomestayEntities(); TAIKHOAN tk = new TAIKHOAN(); tk.HoTen = "Nguyễn Thanh Hùng"; tk.Email = null; tk.Phone = "0956557103"; tk.TaiKhoan1 = "hung123"; tk.Matkhau = "12345709"; bool expected = true; bool actual = Register.addNew(db, tk); Assert.AreEqual(expected, actual); }
public void TestDangKyDayDuMKMax() { QuanLyHomestayEntities db = new QuanLyHomestayEntities(); TAIKHOAN tk = new TAIKHOAN(); tk.HoTen = "Vũ Thanh Hưng"; tk.Email = "*****@*****.**"; tk.Phone = "0956557105"; tk.TaiKhoan1 = "thanhhung"; tk.Matkhau = "123456789101112"; bool expected = true; bool actual = Register.addNew(db, tk); Assert.AreEqual(expected, actual); }
public void TestDangKyTrungTaiKhoan() { QuanLyHomestayEntities db = new QuanLyHomestayEntities(); TAIKHOAN tk = new TAIKHOAN(); tk.HoTen = "Nguyễn Văn A"; tk.Email = "*****@*****.**"; tk.Phone = "0909123456"; tk.TaiKhoan1 = "yeupanhmaj"; tk.Matkhau = "789789789"; bool expected = false; bool actual = Register.addNew(db, tk); Assert.AreEqual(expected, actual); }
public void TestDangKyMKQuaDai() { QuanLyHomestayEntities db = new QuanLyHomestayEntities(); TAIKHOAN tk = new TAIKHOAN(); tk.HoTen = "Nguyễn Thanh Bình"; tk.Email = null; tk.Phone = "0956557108"; tk.TaiKhoan1 = "thanhbinh12"; tk.Matkhau = "123456789123456789"; bool expected = false; bool actual = Register.addNew(db, tk); Assert.AreEqual(expected, actual); }
public void TestDangKyMKNull() { QuanLyHomestayEntities db = new QuanLyHomestayEntities(); TAIKHOAN tk = new TAIKHOAN(); tk.HoTen = "Nguyễn Thị Bình"; tk.Email = null; tk.Phone = "0956557111"; tk.TaiKhoan1 = "binh@"; tk.Matkhau = null; bool expected = false; bool actual = Register.addNew(db, tk); Assert.AreEqual(expected, actual); }
public void TestXoaDayDuThongTin() { QuanLyHomestayEntities db = new QuanLyHomestayEntities(); HOADON hd = new HOADON(); hd.NgayDen = DateTime.Parse("5/20/2019"); hd.NgayDi = DateTime.Parse("5/25/2019"); hd.MaLoaiPhong = "NC1"; hd.GiaTien = "299000"; hd.DonVi = "VND"; hd.SoTienDatTruoc = null; hd.MaHoaDon = "E72G4TC7"; hd.NgayThanhToan = DateTime.Parse("5/20/2019"); bool expected = true; bool actual = DatPhong.deletePhong(db, hd); Assert.AreEqual(expected, actual); }
public void TestDatPhongKhongNgayDi() { QuanLyHomestayEntities db = new QuanLyHomestayEntities(); HOADON hd = new HOADON(); hd.NgayDen = DateTime.Parse("5/20/2019"); hd.NgayDi = null; hd.MaLoaiPhong = "NC1"; hd.GiaTien = "299000"; hd.DonVi = "VND"; hd.SoTienDatTruoc = null; hd.MaHoaDon = "E72G4TC6"; hd.NgayThanhToan = DateTime.Parse("5/20/2019"); bool expected = false; bool actual = DatPhong.addnewHoaDon(db, hd); Assert.AreEqual(expected, actual); }