public void DeleteEntity() { Guid entityId = Guid.NewGuid(); systemUnderTest = new EntityRepository(MockOrganizationService.Object, MockRetryExecutor.Object, MockEntityMetadataCache.Object); MockOrganizationService.Setup(a => a.Delete(It.IsAny <string>(), It.IsAny <Guid>())); FluentActions.Invoking(() => systemUnderTest.DeleteEntity(entityName, entityId)) .Should() .NotThrow(); MockOrganizationService.VerifyAll(); }
public void DeleteEntities(IEnumerable <MappedEntity> mappedEntities) { foreach (MappedEntity mappedEntity in mappedEntities) { Entity entity = _entityRepository .GetEntityByUniqueValue( mappedEntity.UniqueFieldType, mappedEntity.UniqueFieldValue, LoadLevel.Shallow); if (entity == null) { continue; } _entityRepository.DeleteEntity(entity.Id); } }