Ejemplo n.º 1
0
        public void DetailsTest()
        {
            user v = new user();

            using (var context = new DataContext(_seed, DBTypeEnum.Memory))
            {
                v.DCID     = AddDC();
                v.DeptID   = AddDept();
                v.ITCode   = "XML";
                v.Password = "******";
                v.Name     = "LxL";
                context.Set <user>().Add(v);
                context.SaveChanges();
            }
            PartialViewResult rv = (PartialViewResult)_controller.Details(v.ID.ToString());

            Assert.IsInstanceOfType(rv.Model, typeof(IBaseCRUDVM <TopBasePoco>));
            Assert.AreEqual(v.ID, (rv.Model as IBaseCRUDVM <TopBasePoco>).Entity.GetID());
        }