private AccountProviderLegalEntity CreateBasicRelationship()
 {
     return(DocumentActivator.CreateInstance <AccountProviderLegalEntity>()
            .Set(r => r.Ukprn, Ukprn)
            .Set(r => r.AccountProviderId, AccountProviderId)
            .Set(r => r.AccountId, AccountId)
            .Set(r => r.AccountLegalEntityId, AccountLegalEntityId)
            .Set(r => r.AccountProviderLegalEntityId, AccountProviderLegalEntityId)
            .Add(r => r.OutboxData, new OutboxMessage(CreateMessageId, Created)));
 }
        public DeletePermissionsCommandHandlerTestsFixture()
        {
            Now     = DateTime.UtcNow;
            Command = new DeletePermissionsCommand(1, 12345678, Now.AddHours(-1), Guid.NewGuid().ToString());
            AccountProviderLegalEntity = DocumentActivator.CreateInstance <AccountProviderLegalEntity>().Set(r => r.AccountProviderLegalEntityId, 1).Set(r => r.Ukprn, Command.Ukprn);
            RelationshipsRepository    = new Mock <IAccountProviderLegalEntitiesRepository>();

            AccountProviderLegalEntities = new List <AccountProviderLegalEntity>
            {
                AccountProviderLegalEntity,
                DocumentActivator.CreateInstance <AccountProviderLegalEntity>().Set(r => r.AccountProviderLegalEntityId, 2).Set(r => r.Ukprn, Command.Ukprn)
            };

            RelationshipsRepository.SetupInMemoryCollection(AccountProviderLegalEntities);

            Handler = new DeletePermissionsCommandHandler(RelationshipsRepository.Object);
        }