예제 #1
0
        public string InsertBenhNhan(QLPHONGKHAMEntities db, BenhNhanDTO BenhNhan)
        {
            BENHNHAN benhNhanDAO = new BENHNHAN();

            BUS.Com.Utils.CopyPropertiesFrom(BenhNhan, benhNhanDAO);
            return(benhNhanDao.Save(db, benhNhanDAO));
        }
예제 #2
0
        public void Insert_TestCase3()
        {
            BENHNHAN benhNhan = new BENHNHAN
            {
                MaBenhNhan = TestCommon.LEN_10,
            };
            BenhNhanDAO dao      = new BenhNhanDAO();
            string      actual   = dao.Save(db, benhNhan);
            string      expected = "1111";

            Assert.Equals(expected, actual);
        }
예제 #3
0
        public void Delete_TestCase8()
        {
            BENHNHAN benhNhan = new BENHNHAN
            {
                MaBenhNhan = TestCommon.LEN_10,
                HoTen      = TestCommon.LEN_50,
                CMND       = "123456789012",
            };
            BenhNhanDAO dao    = new BenhNhanDAO();
            string      actual = dao.Save(db, benhNhan);

            Assert.Equals(null, actual);
        }
예제 #4
0
        public void Update_TestCase7()
        {
            BenhNhanDAO dao      = new BenhNhanDAO();
            BENHNHAN    benhNhan = new BENHNHAN
            {
                MaBenhNhan = TestCommon.LEN_10,
                HoTen      = TestCommon.LEN_50,
                CMND       = "123456789012",
            };

            dao.Save(db, benhNhan);
            BENHNHAN benhNhanUpdate = new BENHNHAN
            {
                MaBenhNhan = TestCommon.LEN_10,
            };
            string actual = dao.Save(db, benhNhanUpdate);
            // Biến kết quả
            string expected = "1111";

            // Test
            Assert.Equals(expected, actual);
        }
예제 #5
0
        public void Insert_TestCase2()
        {
            BENHNHAN benhNhan = new BENHNHAN
            {
                MaBenhNhan  = TestCommon.LEN_10 + "1",
                HoTen       = TestCommon.LEN_50 + "1",
                CMND        = "1234567890121",
                NgaySinh    = TestCommon.LEN_8 + "1",
                GioiTinh    = true,
                SoDienThoai = "12356789011",
                DiaChi      = TestCommon.LEN_250 + "1",
                GhiChu      = TestCommon.LEN_250 + "1"
            };
            BenhNhanDAO dao      = new BenhNhanDAO();
            string      actual   = dao.Save(db, benhNhan);
            string      expected = "1111";

            Assert.Equals(expected, actual);
        }