Exemple #1
0
        public async Task GetSingleBadgesToApprove()
        {
            var approveBadgeCollection = await ApproveBadgeCollection.GetAllBadgesToApproveAsync();

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

            Assert.IsNotNull(approveBadgeItem);
        }
        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) }));
        }
Exemple #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();
        }