示例#1
0
        public void Create()
        {
            try
            {
                CTHDSuaXe entity = CreateNewCTHDSuaXe();

                object result = manager.Save(entity);

                Assert.IsNotNull(result);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }
示例#2
0
        public void Read()
        {
            try
            {
                CTHDSuaXe entityA = CreateNewCTHDSuaXe();
                manager.Save(entityA);

                CTHDSuaXe entityB = manager.GetById(entityA.Id);

                Assert.AreEqual(entityA, entityB);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }
示例#3
0
        public void Delete()
        {
            try
            {
                CTHDSuaXe entity = GetFirstCTHDSuaXe();

                manager.Delete(entity);

                entity = manager.GetById(entity.Id);
                Assert.IsNull(entity);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }
示例#4
0
        public void Update()
        {
            try
            {
                CTHDSuaXe entityA = GetFirstCTHDSuaXe();
                entityA.STT = 8;

                manager.Update(entityA);

                CTHDSuaXe entityB = manager.GetById(entityA.Id);

                Assert.AreEqual(entityA.STT, entityB.STT);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }
示例#5
0
        protected CTHDSuaXe CreateNewCTHDSuaXe()
        {
            CTHDSuaXe entity = new CTHDSuaXe();


            entity.STT          = 5;
            entity.ChiTietSua   = "Test Test Test Test T";
            entity.SoLuong      = 87;
            entity.DonGium      = 90;
            entity.PhanTramGiam = default(Double);
            entity.ThanhTien    = 81;
            entity.GhiChu       = "Test Test ";
            entity.Loai         = true;

            IHDSuaXeManager hDSuaXeManager = managerFactory.GetHDSuaXeManager();

            entity.HDSuaXeMember = hDSuaXeManager.GetAll(1)[0];

            IPhuTungManager phuTungManager = managerFactory.GetPhuTungManager();

            entity.PhuTungMember = phuTungManager.GetAll(1)[0];

            return(entity);
        }