Ejemplo n.º 1
0
        public void Should_Success_Create_Data()
        {
            ProjectDbContext projectDbContext = MemoryDbHelper.GetDB(Helper.GetCurrentMethod(ENTITY));
            TFacade          tFacade          = (TFacade)Activator.CreateInstance(typeof(TFacade), projectDbContext);

            Assert.NotEqual(0, tFacade.Create(dataUtil.GetModelData()));
        }
Ejemplo n.º 2
0
        public void Should_Success_Read_Data()
        {
            ProjectDbContext projectDbContext = MemoryDbHelper.GetDB(Helper.GetCurrentMethod(ENTITY));
            TFacade          tFacade          = (TFacade)Activator.CreateInstance(typeof(TFacade), projectDbContext);

            projectDbContext.Add(dataUtil.GetModelData());
            projectDbContext.Add(dataUtil.GetModelData());
            projectDbContext.SaveChanges();

            Assert.Equal(2, tFacade.Read().Count);
        }
Ejemplo n.º 3
0
        public void Should_Success_Read_Data_By_Id()
        {
            ProjectDbContext projectDbContext = MemoryDbHelper.GetDB(Helper.GetCurrentMethod(ENTITY));
            TFacade          tFacade          = (TFacade)Activator.CreateInstance(typeof(TFacade), projectDbContext);

            TModel model = dataUtil.GetModelData();

            tFacade.Create(model);
            dynamic result = tFacade.ReadById(model.Id);

            Assert.NotNull(result);
        }