public UserApiService(IUserApiClient userApiClient, IOptions <UserGroupsConfiguration> userGroupsConfiguration, ILogger <UserApiService> logger)
 {
     _userApiClient = userApiClient;
     _userGroups    = userGroupsConfiguration.Value;
     _logger        = logger;
     ValidateGroupsAreSet(userGroupsConfiguration.Value);
 }
 private static void ValidateGroupsAreSet(UserGroupsConfiguration values)
 {
     values.GetType().GetProperties()
     .Where(pi => pi.PropertyType == typeof(string))
     .Select(pi => (string)pi.GetValue(values))
     .Any(string.IsNullOrWhiteSpace)
     .Should().BeFalse("All user group values are set");
 }
Beispiel #3
0
 public Dictionary <UserType, IUserGroupsStrategy> GetStrategies(UserGroupsConfiguration configuration)
 {
     return(new Dictionary <UserType, IUserGroupsStrategy>
     {
         { UserType.Judge, new JudgeGroupsStrategy(configuration) },
         { UserType.Individual, new IndividualGroupsStrategy(configuration) },
         { UserType.PanelMember, new JohGroupsStrategy(configuration) },
         { UserType.Winger, new JohGroupsStrategy(configuration) },
         { UserType.Observer, new IndividualGroupsStrategy(configuration) },
         { UserType.Representative, new RepresentativeGroupsStrategy(configuration) },
         { UserType.CaseAdmin, new CaseAdminGroupsStrategy(configuration) },
         { UserType.VideoHearingsOfficer, new VideoHearingsOfficerGroupsStrategy(configuration) },
         { UserType.Tester, new TesterGroupsStrategy(configuration) },
         { UserType.Witness, new WitnessGroupsStrategy(configuration) },
         { UserType.Interpreter, new InterpreterGroupsStrategy(configuration) }
     });
 }
Beispiel #4
0
        private void SetMockGroups()
        {
            var groups = new UserGroupsConfiguration
            {
                JudgeGroups                  = GroupData.FAKE_JUDGE_GROUPS,
                IndividualGroups             = GroupData.FAKE_INDIVIDUAL_GROUPS,
                RepresentativeGroups         = GroupData.FAKE_REPRESENTATIVE_GROUPS,
                VideoHearingsOfficerGroups   = GroupData.FAKE_VIDEO_HEARINGS_OFFICER_GROUPS,
                CaseAdminGroups              = GroupData.FAKE_CASE_ADMIN_GROUPS,
                KinlyGroups                  = GroupData.FAKE_KINLY_GROUPS,
                KinlyProdGroups              = GroupData.FAKE_KINLY_PROD_GROUPS,
                TestAccountGroups            = GroupData.FAKE_TEST_GROUPS,
                TestWebGroups                = GroupData.FAKE_TEST_WEB_GROUPS,
                PerformanceTestAccountGroups = GroupData.FAKE_PERFORMANCE_TEST_GROUPS,
                JudicialOfficeGroups         = GroupData.FAKE_JOH_GROUPS,
                WitnessGroups                = GroupData.FAKE_WITNESS_GROUPS,
                InterpreterGroups            = GroupData.FAKE_INTERPRETER_GROUPS
            };

            GroupsConfig
            .Setup(x => x.Value)
            .Returns(groups);
        }
Beispiel #5
0
 public CaseAdminGroupsStrategy(UserGroupsConfiguration configuration)
 {
     _configuration = configuration;
 }
Beispiel #6
0
 public RepresentativeGroupsStrategy(UserGroupsConfiguration configuration)
 {
     _configuration = configuration;
 }
Beispiel #7
0
 public IndividualGroupsStrategy(UserGroupsConfiguration configuration)
 {
     _configuration = configuration;
 }
Beispiel #8
0
 public JudgeGroupsStrategy(UserGroupsConfiguration configuration)
 {
     _configuration = configuration;
 }
Beispiel #9
0
 public InterpreterGroupsStrategy(UserGroupsConfiguration configuration)
 {
     _configuration = configuration;
 }
Beispiel #10
0
 public WitnessGroupsStrategy(UserGroupsConfiguration configuration)
 {
     _configuration = configuration;
 }
Beispiel #11
0
 public TesterGroupsStrategy(UserGroupsConfiguration configuration)
 {
     _configuration = configuration;
 }
Beispiel #12
0
 public VideoHearingsOfficerGroupsStrategy(UserGroupsConfiguration configuration)
 {
     _configuration = configuration;
 }