コード例 #1
0
        public void DetailsTest()
        {
            PlayerState v = new PlayerState();

            using (var context = new DataContext(_seed, DBTypeEnum.Memory))
            {
                v.LevelExp    = 44;
                v.MaxLifeTime = 69;
                v.CurrentLife = 52;
                v.Energy      = 93;
                v.Money       = 7;
                v.Gold        = 55;
                context.Set <PlayerState>().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());
        }