コード例 #1
0
        public void ShouldInsertWhenPreferenceUserRepositoryIsValid()
        {
            var entity = FactoryPreferenceUser.RandomCreate();

            _spacePlanningUnitOfWork.PreferenceUserRepository.Add(entity);
            _spacePlanningUnitOfWork.Save();
            var retrived = _spacePlanningUnitOfWork.PreferenceUserRepository.GetById(entity.UserId, entity.PreferenceId);

            Assert.IsTrue(retrived.Equals(entity));
        }
コード例 #2
0
        public void ShoultDeleteWhenPreferenceUserRepositoryIsValid()
        {
            var entity = FactoryPreferenceUser.RandomCreate();

            _spacePlanningUnitOfWork.PreferenceUserRepository.Add(entity);
            _spacePlanningUnitOfWork.Save();

            _spacePlanningUnitOfWork.PreferenceUserRepository.Delete(entity);
            _spacePlanningUnitOfWork.Save();
            var retrived = _spacePlanningUnitOfWork.PreferenceUserRepository.GetById(entity.PreferenceId, entity.UserId);

            Assert.IsNull(retrived);
        }