예제 #1
0
        public void DetailsTest()
        {
            Connection v = new Connection();

            using (var context = new DataContext(_seed, DBTypeEnum.Memory))
            {
                v.Name     = "KgH";
                v.Host     = "gMTL";
                v.Port     = 12;
                v.Database = "tBEa";
                v.Username = "******";
                v.Password = "******";
                v.ID       = 10;
                context.Set <Connection>().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());
        }