Ejemplo n.º 1
0
        public async Task Activation(Guid activationCode)
        {
            DeveloperActivation operation = new DeveloperActivation(_AuthorityContext, activationCode);
            await operation.Do();

            await operation.CommitAsync();
        }
Ejemplo n.º 2
0
        public async Task ActivationShouldSuccess()
        {
            Developer developer = await TestOperations.RegisterDeveloper(_fixture.Context);

            DeveloperActivation activationOperation = new DeveloperActivation(_fixture.Context, developer.PendingRegistrationId);
            await activationOperation.Do();

            await activationOperation.CommitAsync();

            Developer existingDeveloper = _fixture.Context.ReloadEntity <Developer>(developer.Id);

            Assert.False(existingDeveloper.IsPending);
            Assert.True(existingDeveloper.PendingRegistrationId == Guid.Empty);
        }
Ejemplo n.º 3
0
        public static async Task <Developer> RegisterAndActivateDeveloper(
            AuthorityContext context,
            string password = "")
        {
            string email    = RandomData.Email();
            string username = RandomData.RandomString();

            password = password == "" ? RandomData.RandomString(12, true) : password;

            DeveloperRegistration registration = new DeveloperRegistration(context, email, username, password);
            Developer             developer    = await registration.Do();

            await registration.CommitAsync();

            DeveloperActivation activation = new DeveloperActivation(context, developer.PendingRegistrationId);
            await activation.Do();

            await activation.CommitAsync();

            return(developer);
        }