コード例 #1
0
        public void Can_Perform_Delete_On_RelationTypeRepository()
        {
            // Arrange
            var provider   = new PetaPocoUnitOfWorkProvider();
            var unitOfWork = provider.GetUnitOfWork();
            var repository = new RelationTypeRepository(unitOfWork);

            // Act
            var relationType = repository.Get(3);

            repository.Delete(relationType);
            unitOfWork.Commit();

            var exists = repository.Exists(3);

            // Assert
            Assert.That(exists, Is.False);
        }
コード例 #2
0
        public void Can_Perform_Delete_On_RelationTypeRepository()
        {
            // Arrange
            IScopeProvider provider = ScopeProvider;

            using (provider.CreateScope())
            {
                RelationTypeRepository repository = CreateRepository(provider);

                // Act
                IRelationType relationType = repository.Get(3);
                repository.Delete(relationType);

                bool exists = repository.Exists(3);

                // Assert
                Assert.That(exists, Is.False);
            }
        }
コード例 #3
0
        public void Can_Perform_Delete_On_RelationTypeRepository()
        {
            // Arrange
            var provider = new PetaPocoUnitOfWorkProvider();
            var unitOfWork = provider.GetUnitOfWork();
            var repository = new RelationTypeRepository(unitOfWork);

            // Act
            var relationType = repository.Get(3);
            repository.Delete(relationType);
            unitOfWork.Commit();

            var exists = repository.Exists(3);

            // Assert
            Assert.That(exists, Is.False);
        }