Exemple #1
0
        public GroupServiceTests()
        {
            var user = AppUser.CreateOrganizationOwner("*****@*****.**", "user1");

            dbContext.Users.Add(user);
            dbContext.SaveChanges();
            var userContextMock = new Mock <IUserContext>();

            userId = user.Id;
            userContextMock.Setup(x => x.UserId).Returns(userId);
            userContext = userContextMock.Object;
        }
Exemple #2
0
        private async Task AddOrganizationOwners()
        {
            for (int i = 1; i <= 4; i++)
            {
                var username = $"Owner{i}";
                var email    = username + "@example.com";
                var owner    = AppUser.CreateOrganizationOwner(email, username);
                OrganizationOwners.Add(owner);
            }

            foreach (var owner in OrganizationOwners)
            {
                await AddUser(owner);
            }
        }
Exemple #3
0
        public async Task <OperationResult <Unit> > RegisterOrganizationOwner(string email, string username, string password)
        {
            var user = AppUser.CreateOrganizationOwner(email, username);

            return(await CreateUser(password, user));
        }