示例#1
0
        public void DetailsTest()
        {
            var response = _controller.Details("1", 1);

            Assert.IsNotNull(response);
            Assert.IsInstanceOfType(response, typeof(ViewResult));
            Assert.IsInstanceOfType((response as ViewResult).Model, typeof(Patient));
            var patient = (response as ViewResult).Model as Patient;

            Assert.IsTrue(patient.FullName == GetTestPatients().First().FullName);
        }
示例#2
0
        public void DetailsTest()
        {
            Patient v = new Patient();

            using (var context = new DataContext(_seed, DBTypeEnum.Memory))
            {
                v.ID       = 92;
                v.IdNumber = "9hTGN";
                v.PhotoId  = AddPhoto();
                context.Set <Patient>().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());
        }