Exemplo n.º 1
0
        public void ShouldInsertWhenObjectRepositoryIsValid()
        {
            Object entity = FactoryObject.RandomCreate();

            _spacePlanningUnitOfWork.ObjectRepository.Add(entity);
            _spacePlanningUnitOfWork.Save();
            var retrived = _spacePlanningUnitOfWork.ObjectRepository.GetById(entity.ObjectId);

            Assert.IsTrue(retrived.Equals(entity));
        }
Exemplo n.º 2
0
        public void ShouldDeleteWhenObjectRepositoryIsValid()
        {
            Object entity = FactoryObject.RandomCreate();

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

            _spacePlanningUnitOfWork.ObjectRepository.Delete(entity);
            _spacePlanningUnitOfWork.Save();
            var retrived = _spacePlanningUnitOfWork.ObjectRepository.GetById(entity.ObjectId);

            Assert.IsNull(retrived);
        }