Example #1
0
        public void ShouldAddClaimSet()
        {
            var testApplication = new Application
            {
                ApplicationName = $"Test Application {DateTime.Now:O}"
            };

            Save(testApplication);

            var newClaimSet = new AddClaimSetModel {
                ClaimSetName = "TestClaimSet"
            };

            int addedClaimSetId = 0;

            Scoped <ISecurityContext>(securityContext =>
            {
                var command = new AddClaimSetCommand(securityContext);

                addedClaimSetId = command.Execute(newClaimSet);
            });

            var addedClaimSet = Transaction(securityContext => securityContext.ClaimSets.Single(x => x.ClaimSetId == addedClaimSetId));

            addedClaimSet.ClaimSetName.ShouldBe(newClaimSet.ClaimSetName);
        }
        public ActionResult AddClaimSet(AddClaimSetModel model)
        {
            var claimSetId = _addClaimSetCommand.Execute(model);

            var editClaimSetModel = GetEditClaimSetModel(claimSetId);

            return(PartialView("_EditClaimSet", editClaimSetModel));
        }
        public void ShouldAddClaimSet()
        {
            var testApplication = new Application
            {
                ApplicationName = $"Test Application {DateTime.Now:O}"
            };

            Save(testApplication);

            var newClaimSet = new AddClaimSetModel {
                ClaimSetName = "TestClaimSet"
            };

            var command = new AddClaimSetCommand(TestContext);

            var addedClaimSetId = command.Execute(newClaimSet);

            var addedClaimSet = TestContext.ClaimSets.Single(x => x.ClaimSetId == addedClaimSetId);

            addedClaimSet.ClaimSetName.ShouldBe(newClaimSet.ClaimSetName);
        }
        public ActionResult AddClaimSet(AddClaimSetModel model)
        {
            var id = _addClaimSetCommand.Execute(model);

            return(RedirectToAction("EditClaimSet", "ClaimSets", new { claimSetId = id }));
        }