コード例 #1
0
        public async Task GetSingleBadgesToApprove()
        {
            var approveBadgeCollection = await ApproveBadgeCollection.GetAllBadgesToApproveAsync();

            var approveBadgeItem = await ApproveBadgeItem.GetBadgesToApproveByIdAsync(approveBadgeCollection[0].BadgeId);

            Assert.IsNotNull(approveBadgeItem);
        }
コード例 #2
0
        public async virtual Task <ActionResult> RejectBadgeSubmission(int badgeId)
        {
            var badgeToReject = await ApproveBadgeItem.GetBadgesToApproveByIdAsync(badgeId);

            badgeToReject.DenyBadge();

            if (await(SaveObjectAsync(badgeToReject, true)))
            {
                return(Json(new { Success = true }));
            }
            return(Json(new { Success = false, Message = ModelState.Values.SelectMany(ms => ms.Errors).Select(me => me.ErrorMessage) }));
        }
コード例 #3
0
        public async Task ApproveBadge()
        {
            Csla.ApplicationContext.User = await CustomPrincipal.LogOnAsync(Constants.ReneeBUserName, "");

            var approveBadgeItem = await ApproveBadgeItem.GetBadgesToApproveByIdAsync(1);

            approveBadgeItem.ApproveBadge(Constants.ReneeBUserId);

            approveBadgeItem = (IApproveBadgeItem)approveBadgeItem.Save();

            Assert.IsNotNull(approveBadgeItem);
            Csla.ApplicationContext.User = new UnauthenticatedPrincipal();
        }