public TalentLmsHealthCheck(
     ITalentLmsApiService talentLmsApiService,
     ILogger <TalentLmsHealthCheck> logger)
 {
     _talentLmsApiService = talentLmsApiService ?? throw new ArgumentNullException(nameof(talentLmsApiService));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Пример #2
0
 public TalentLmsProviderService(
     ITalentLmsApiService apiService,
     ApplicationDbContext context,
     ILogger <TalentLmsProviderService> logger) : base(context, logger)
 {
     _apiService = apiService ?? throw new ArgumentNullException(nameof(apiService));
 }
        public static async Task DeleteAllUsersAsync(this ITalentLmsApiService service)
        {
            var adminUserId = Environment.GetEnvironmentVariable(TalentLmsTestEnv.UserIdEnvKey);

            if (string.IsNullOrWhiteSpace(adminUserId))
            {
                throw new InvalidOperationException($"{TalentLmsTestEnv.UserIdEnvKey} env variable is not set");
            }

            var users = await service.ListAllUsersAsync();

            foreach (var user in users)
            {
                if (!adminUserId.Equals(user.Id))
                {
                    await service.DeleteUserAsync(user.Id, adminUserId);
                }
            }
        }
 public TalentLmsApiServiceTests(ITestOutputHelper output)
 {
     _service = new TalentLmsApiService(_httpClientFactory,
                                        Options.Create(TalentLmsTestEnv.GetSettingsFromEnv()),
                                        XUnitLoggerFactory.CreateLogger <TalentLmsApiService>(output));
 }