public Guid AddUser(string accountName, AccountType type, string displayName, IEnumerable<string> authenticatedGroups, IEnumerable<KeyValuePair<string, string>> customProperties) { Guid userId = Guid.NewGuid(); var properties = customProperties != null ? customProperties.ToList() : null; var createUserCommand = new CreateUserCommand(userId, displayName, properties); commandBus.Value.Send(Envelope.Create(createUserCommand)); var createAccountCommand = new CreateExternalUserAccountCommand(userId, type, accountName); commandBus.Value.Send(Envelope.Create(createAccountCommand)); SetRolesAndGroups(userId, authenticatedGroups); return userId; }
private void MockUser(CreateExternalUserAccountCommand createExternalUserAccountCommand) { var user = new User { Id = createExternalUserAccountCommand.UserId }; queryService.GetUser(Arg.Is<string>(o => o == createExternalUserAccountCommand.Name), (Querying.Data.AccountType)AccountType).Returns(user); }