コード例 #1
0
        public async Task Handle_ValidAdminValidGroupSlug_IsCurrentMemberAdminAsync()
        {
            var currentMemberUsername = "******";
            var invitedToGroupSlug    = "group-slug";

            var response = await _groupAddMemberService.IsCurrentMemberAdminAsync(currentMemberUsername, invitedToGroupSlug, CancellationToken.None);

            Assert.IsTrue(response);
        }
コード例 #2
0
        public async Task <ActionResult> AddMemberAsync(string slug, CancellationToken cancellationToken)
        {
            var currentMemberUsername = System.Web.HttpContext.Current.User.Identity.Name;

            if (!await _addMemberService.IsCurrentMemberAdminAsync(currentMemberUsername, slug, cancellationToken))
            {
                return(RedirectToRoute("GroupUrls", new { slug }));
            }

            ViewBag.HideSideBar = true;

            var model = new GroupAddMemberViewModel
            {
                Slug = slug,
            };

            return(View(model));
        }