private async Task <HubActionTester <int, ResourceGroupModel[]> > setup()
        {
            var host     = new HubTestHost();
            var services = await host.Setup();

            return(HubActionTester.Create(services, hubApi => hubApi.ModCategory.GetResourceGroups));
        }
        private async Task <HubActionTester <EmptyRequest, ModifierModel> > setup()
        {
            var host     = new HubTestHost();
            var services = await host.Setup();

            return(HubActionTester.Create(services, hubApi => hubApi.App.GetDefaultModiifer));
        }
        private async Task <HubActionTester <EmptyRequest, AppVersionModel> > setup()
        {
            var host     = new HubTestHost();
            var services = await host.Setup();

            return(HubActionTester.Create(services, hubApi => hubApi.Version.GetCurrentVersion));
        }
Exemple #4
0
        private async Task <HubActionTester <AddUserModel, int> > setup()
        {
            var host     = new HubTestHost();
            var services = await host.Setup();

            return(HubActionTester.Create(services, hubApi => hubApi.Users.AddUser));
        }
        private async Task <HubActionTester <int, UserModifierCategoryModel[]> > setup()
        {
            var host     = new HubTestHost();
            var services = await host.Setup();

            return(HubActionTester.Create(services, hubApi => hubApi.AppUser.GetUserModCategories));
        }
        private async Task <HubActionTester <EditUserForm, EmptyActionResult> > setup()
        {
            var host     = new HubTestHost();
            var services = await host.Setup();

            return(HubActionTester.Create(services, hubApi => hubApi.UserMaintenance.EditUser));
        }
Exemple #7
0
        private async Task <HubActionTester <EmptyRequest, AppUserModel[]> > setup()
        {
            var host     = new HubTestHost();
            var services = await host.Setup();

            return(HubActionTester.Create(services, hubApi => hubApi.Users.GetUsers));
        }
Exemple #8
0
        private async Task <HubActionTester <UserRoleRequest, EmptyActionResult> > setup()
        {
            var host     = new HubTestHost();
            var services = await host.Setup();

            return(HubActionTester.Create(services, hubApi => hubApi.AppUserMaintenance.UnassignRole));
        }
        private async Task <HubActionTester <int, WebRedirectResult> > setup()
        {
            var host     = new HubTestHost();
            var services = await host.Setup();

            return(HubActionTester.Create(services, hubApi => hubApi.Apps.RedirectToApp));
        }
Exemple #10
0
        private async Task <HubActionTester <NewVersionRequest, AppVersionModel> > setup()
        {
            var host     = new HubTestHost();
            var services = await host.Setup();

            return(HubActionTester.Create(services, hubApi => hubApi.AppRegistration.NewVersion));
        }
        private static async Task addEditUserRole(HubActionTester <EditUserForm, EmptyActionResult> tester, AppUser loggedInUser)
        {
            var app = await tester.HubApp();

            var editUserRole = await app.Role(HubInfo.Roles.EditUser);

            await loggedInUser.AddRole(editUserRole);
        }
        private async Task <AppUser> addUser(HubActionTester <EditUserForm, EmptyActionResult> tester, string userName)
        {
            var addUserTester = tester.Create(hubApi => hubApi.Users.AddUser);
            var adminUser     = await addUserTester.AdminUser();

            var userID = await addUserTester.Execute(new AddUserModel
            {
                UserName = userName,
                Password = "******"
            }, adminUser);

            var factory = tester.Services.GetService <AppFactory>();
            var user    = await factory.Users().User(new AppUserName(userName));

            return(user);
        }
 public AppModifierAssertions(HubActionTester <TModel, TResult> tester)
 {
     this.tester = tester;
 }
 public static AppModifierAssertions <TModel, TResult> Create <TModel, TResult>(HubActionTester <TModel, TResult> tester)
 {
     return(new AppModifierAssertions <TModel, TResult>(tester));
 }