Test.CustomerExample.BO.AuthorisationStub.AddAuthorisedRole C# (CSharp) Method

AddAuthorisedRole() public method

This is a public method to be used for setting up tests.
public AddAuthorisedRole ( string role, BusinessObjectActions actionToPerform ) : void
role string the role that the user must be a member of
actionToPerform BusinessObjectActions The action that can be performed by a user of this role
return void
        public void AddAuthorisedRole(string role, BusinessObjectActions actionToPerform)
        {
            if (actionsAllowed.Contains(actionToPerform)) return;

            actionsAllowed.Add(actionToPerform);
        }
        /// <summary>

Usage Example

 private static IBusinessObjectAuthorisation GetAuthorisationStub_CanRead_True()
 {
     IBusinessObjectAuthorisation authorisationStub = new AuthorisationStub();
     authorisationStub.AddAuthorisedRole("A Role", BusinessObjectActions.CanRead);
     authorisationStub.AddAuthorisedRole("A Role", BusinessObjectActions.CanCreate);
     return authorisationStub;
 }
All Usage Examples Of Test.CustomerExample.BO.AuthorisationStub::AddAuthorisedRole