public void ShouldEditClaimSet()
        {
            var testApplication = new Application
            {
                ApplicationName = $"Test Application {DateTime.Now:O}"
            };

            Save(testApplication);

            var alreadyExistingClaimSet = new ClaimSet {
                ClaimSetName = "TestClaimSet", Application = testApplication
            };

            Save(alreadyExistingClaimSet);

            var editModel = new EditClaimSetModel {
                ClaimSetName = "TestClaimSetEdited", ClaimSetId = alreadyExistingClaimSet.ClaimSetId
            };

            Scoped <ISecurityContext>(securityContext =>
            {
                var command = new EditClaimSetCommand(securityContext);
                command.Execute(editModel);
            });

            var editedClaimSet = Transaction(securityContext => securityContext.ClaimSets.Single(x => x.ClaimSetId == alreadyExistingClaimSet.ClaimSetId));

            editedClaimSet.ClaimSetName.ShouldBe(editModel.ClaimSetName);
        }
 public ClaimSetsController(IGetClaimSetByIdQuery getClaimSetByIdQuery
                            , IGetApplicationsByClaimSetIdQuery getApplicationsByClaimSetIdQuery
                            , IGetResourcesByClaimSetIdQuery getResourcesByClaimSetIdQuery
                            , IGetClaimSetsByApplicationNameQuery getClaimSetsByApplicationNameQuery
                            , IGetAuthStrategiesByApplicationNameQuery getAuthStrategiesByApplicationNameQuery
                            , ITabDisplayService tabDisplayService
                            , CopyClaimSetCommand copyClaimSetCommand
                            , AddClaimSetCommand addClaimSetCommand
                            , EditClaimSetCommand editClaimSetCommand
                            , GetResourceClaimsQuery getResourceClaimsQuery
                            , GetChildResourceClaimsForParentQuery getChildResourceClaimsForParentQuery
                            , DeleteClaimSetCommand deleteClaimSetCommand
                            , EditResourceOnClaimSetCommand editResourceOnClaimSetCommand
                            , DeleteResourceOnClaimSetCommand deleteResourceOnClaimSetCommand
                            , ClaimSetFileExportCommand claimSetFileExportCommand
                            , ClaimSetFileImportCommand claimSetFileImportCommand
                            , OverrideDefaultAuthorizationStrategyCommand overrideDefaultAuthorizationStrategyCommand
                            , ResetToDefaultAuthStrategyCommand resetToDefaultAuthStrategyCommand)
 {
     _getClaimSetByIdQuery                    = getClaimSetByIdQuery;
     _getApplicationsByClaimSetIdQuery        = getApplicationsByClaimSetIdQuery;
     _getResourcesByClaimSetIdQuery           = getResourcesByClaimSetIdQuery;
     _getClaimSetsByApplicationNameQuery      = getClaimSetsByApplicationNameQuery;
     _getAuthStrategiesByApplicationNameQuery = getAuthStrategiesByApplicationNameQuery;
     _tabDisplayService      = tabDisplayService;
     _copyClaimSetCommand    = copyClaimSetCommand;
     _addClaimSetCommand     = addClaimSetCommand;
     _editClaimSetCommand    = editClaimSetCommand;
     _getClaimSetByIdQuery   = getClaimSetByIdQuery;
     _getResourceClaimsQuery = getResourceClaimsQuery;
     _getChildResourceClaimsForParentQuery = getChildResourceClaimsForParentQuery;
     _deleteClaimSetCommand                       = deleteClaimSetCommand;
     _editResourceOnClaimSetCommand               = editResourceOnClaimSetCommand;
     _deleteResourceOnClaimSetCommand             = deleteResourceOnClaimSetCommand;
     _claimSetFileExportCommand                   = claimSetFileExportCommand;
     _claimSetFileImportCommand                   = claimSetFileImportCommand;
     _overrideDefaultAuthorizationStrategyCommand = overrideDefaultAuthorizationStrategyCommand;
     _resetToDefaultAuthStrategyCommand           = resetToDefaultAuthStrategyCommand;
 }