Example #1
0
        private int GetRandomUnusedIndex()
        {
            int index;

            do
            {
                index = RandomNumberHelper.GenerateRandomNumber(100);
            } while (indexOfUsedPermissions.Contains(index));

            return(index);
        }
Example #2
0
        public List <string> SelectRandomPermissions()
        {
            PermissionAutoGenStore permissionStore = new PermissionAutoGenStore();
            int           numberOfPermissions      = RandomNumberHelper.GenerateRandomNumber(100);
            List <string> permissionList           = new List <string>();

            for (int a = 1; a <= numberOfPermissions; a++)
            {
                var index = GetRandomUnusedIndex();
                indexOfUsedPermissions.Add(index);
                var randomPermission = permissionStore.GetUserPermissionByIndex(index - 1);
                permissionList.Add(randomPermission);
            }

            return(permissionList);
        }
Example #3
0
 public string SelectRandomColor()
 {
     return(_colorList[RandomNumberHelper.GenerateRandomNumber(_colorList.Count)]);
 }