private void CreateDefaultEntities()
        {
            Account = new Account(
                id: 1,
                hashedId: "HashedId",
                publicHashedId: "PublicHashedId",
                name: "Account",
                created: DateTime.UtcNow);
            Db.Add(Account);

            AccountLegalEntity = new AccountLegalEntity(
                account: Account,
                id: 12345,
                publicHashedId: "ALE1",
                name: "Account legal entity 1",
                created: DateTime.UtcNow);
            Db.Add(AccountLegalEntity);

            Provider = EntityActivator
                       .CreateInstance <Provider>()
                       .Set(x => x.Ukprn, 299792458);
            Db.Add(Provider);

            User = new User(Guid.NewGuid(), "*****@*****.**", "Bill", "Gates");
            Db.Add(User);

            AccountProvider = new AccountProvider(Account, Provider, User, null);
            AccountProvider.Set(x => x.Id, 23);
            Db.Add(AccountProvider);

            AccountProviderLegalEntity = new AccountProviderLegalEntity(
                accountProvider: AccountProvider,
                accountLegalEntity: AccountLegalEntity,
                user: User,
                grantedOperations: new HashSet <Operation>(new[] { Operation.CreateCohort, Operation.Recruitment }));
            AccountProviderLegalEntity.Set(x => x.Id, 34);
            Db.Add(AccountProviderLegalEntity);

            Db.SaveChanges();
        }
        public DeletePermissionsCommandHandlerTestsFixture SetAccountProviderLegalEntityDeletedBeforeCommand()
        {
            AccountProviderLegalEntity.Set(ale => ale.Deleted, Command.Deleted.AddHours(-1));

            return(this);
        }
        public DeletePermissionsCommandHandlerTestsFixture SetAccountProviderLegalEntityDeletedAfterCommand()
        {
            AccountProviderLegalEntity.Set(ale => ale.Deleted, Now);

            return(this);
        }